home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / rpcndr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  77.8 KB  |  3,084 lines

  1. /*++
  2.  
  3. Copyright (c) 1992-1997 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     rpcndr.h
  8.  
  9. Abstract:
  10.  
  11.     Definitions for stub data structures and prototypes of helper functions.
  12.  
  13. Author:
  14.  
  15.     DonnaLi (01-01-91)
  16.  
  17. Environment:
  18.  
  19.     DOS, Win 3.X, and Win/NT.
  20.  
  21. Revision History:
  22.  
  23.    DONNALI  08-29-91     Start recording history
  24.    donnali  09-11-91     change conversion macros
  25.    donnali  09-18-91     check in files for moving
  26.    STEVEZ   10-15-91     Merge with NT tree
  27.    donnali  10-28-91     add prototype
  28.    donnali  11-19-91     bugfix for strings
  29.    MIKEMON  12-17-91     DCE runtime API conversion
  30.    donnali  03-24-92     change rpc public header f
  31.    STEVEZ   04-04-92     add nsi include
  32.    mikemon  04-18-92     security support and misc
  33.    DovhH    04-24-24     Changed signature of <int>_from_ndr
  34.                          (to unsigned <int>)
  35.                          Added <base_type>_array_from_ndr routines
  36.    RyszardK 06-17-93     Added support for hyper
  37.    VibhasC  09-11-93     Created rpcndrn.h
  38.    DKays    10-14-93     Fixed up rpcndrn.h MIDL 2.0
  39.    RyszardK 01-15-94     Merged in the midl 2.0 changes from rpcndrn.h
  40.    Stevebl  04-22-96     Hookole support changes to MIDL_*_INFO
  41.    RyszardK 05-20-97     Added async support, started version at 450.
  42.  
  43. --*/
  44.  
  45.  
  46. #ifndef __RPCNDR_H__
  47. #define __RPCNDR_H__
  48. #pragma option push -b
  49.  
  50. // This version of the rpcproxy.h file corresponds to MIDL version 3.3.106
  51. // used with NT5 beta env from build #1574 on.
  52.  
  53. #ifndef __RPCNDR_H_VERSION__
  54. #define __RPCNDR_H_VERSION__        ( 450 )
  55. #endif // __RPCNDR_H_VERSION__
  56.  
  57. #ifdef __REQUIRED_RPCNDR_H_VERSION__
  58.     #if ( __RPCNDR_H_VERSION__ < __REQUIRED_RPCNDR_H_VERSION__ )
  59.         #error incorrect <rpcndr.h> version. Use the header that matches with the MIDL compiler.
  60.     #endif
  61. #endif
  62.  
  63.  
  64. //
  65. // Set the packing level for RPC structures for Dos, Windows and Mac.
  66. //
  67.  
  68. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__) || defined(__RPC_MAC__)
  69. #pragma pack(2)
  70. #endif
  71.  
  72. #if defined(__RPC_MAC__)
  73. #define _MAC_
  74. #endif
  75.  
  76. #include <rpcnsip.h>
  77.  
  78. #ifdef __cplusplus
  79. extern "C" {
  80. #endif
  81.  
  82. /****************************************************************************
  83.  
  84.      Network Computing Architecture (NCA) definition:
  85.  
  86.      Network Data Representation: (NDR) Label format:
  87.      An unsigned long (32 bits) with the following layout:
  88.  
  89.      3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  90.      1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  91.     +---------------+---------------+---------------+-------+-------+
  92.     |   Reserved    |   Reserved    |Floating point | Int   | Char  |
  93.     |               |               |Representation | Rep.  | Rep.  |
  94.     +---------------+---------------+---------------+-------+-------+
  95.  
  96.      Where
  97.  
  98.          Reserved:
  99.  
  100.              Must be zero (0) for NCA 1.5 and NCA 2.0.
  101.  
  102.          Floating point Representation is:
  103.  
  104.              0 - IEEE
  105.              1 - VAX
  106.              2 - Cray
  107.              3 - IBM
  108.  
  109.          Int Rep. is Integer Representation:
  110.  
  111.              0 - Big Endian
  112.              1 - Little Endian
  113.  
  114.          Char Rep. is Character Representation:
  115.  
  116.              0 - ASCII
  117.              1 - EBCDIC
  118.  
  119.      The Microsoft Local Data Representation (for all platforms which are
  120.      of interest currently is edefined below:
  121.  
  122.  ****************************************************************************/
  123.  
  124. #define NDR_CHAR_REP_MASK               (unsigned long)0X0000000FL
  125. #define NDR_INT_REP_MASK                (unsigned long)0X000000F0L
  126. #define NDR_FLOAT_REP_MASK              (unsigned long)0X0000FF00L
  127.  
  128. #define NDR_LITTLE_ENDIAN               (unsigned long)0X00000010L
  129. #define NDR_BIG_ENDIAN                  (unsigned long)0X00000000L
  130.  
  131. #define NDR_IEEE_FLOAT                  (unsigned long)0X00000000L
  132. #define NDR_VAX_FLOAT                   (unsigned long)0X00000100L
  133.  
  134. #define NDR_ASCII_CHAR                  (unsigned long)0X00000000L
  135. #define NDR_EBCDIC_CHAR                 (unsigned long)0X00000001L
  136.  
  137. #if defined(__RPC_MAC__)
  138. #define NDR_LOCAL_DATA_REPRESENTATION   (unsigned long)0X00000000L
  139. #define NDR_LOCAL_ENDIAN                NDR_BIG_ENDIAN
  140. #else
  141. #define NDR_LOCAL_DATA_REPRESENTATION   (unsigned long)0X00000010L
  142. #define NDR_LOCAL_ENDIAN                NDR_LITTLE_ENDIAN
  143. #endif
  144.  
  145.  
  146. /****************************************************************************
  147.  *  Macros for targeted platforms
  148.  ****************************************************************************/
  149.  
  150. #if (0x500 <= _WIN32_WINNT)
  151. #define TARGET_IS_NT50_OR_LATER                   1
  152. #else
  153. #define TARGET_IS_NT50_OR_LATER                   0
  154. #endif
  155.  
  156. #if (defined(_WIN32_DCOM) || 0x400 <= _WIN32_WINNT)
  157. #define TARGET_IS_NT40_OR_LATER                   1
  158. #else
  159. #define TARGET_IS_NT40_OR_LATER                   0
  160. #endif
  161.  
  162. #if (0x400 <= WINVER)
  163. #define TARGET_IS_NT351_OR_WIN95_OR_LATER         1
  164. #else
  165. #define TARGET_IS_NT351_OR_WIN95_OR_LATER         0
  166. #endif
  167.  
  168. /****************************************************************************
  169.  *  Other MIDL base types / predefined types:
  170.  ****************************************************************************/
  171.  
  172. #if defined(__BORLANDC__) /* 'small' is a poor choice for a name.  We better
  173.                               change it to something more legal. */
  174. #  define __small char
  175. #else
  176. #  define small char
  177. #endif /* __BORLANDC__ */
  178.  
  179. typedef unsigned char byte;
  180. typedef unsigned char boolean;
  181.  
  182. #ifndef _HYPER_DEFINED
  183. #define _HYPER_DEFINED
  184.  
  185. #if !defined(__RPC_DOS__) && !defined(__RPC_WIN16__) && !defined(__RPC_MAC__) && (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64))
  186. #define  hyper           __int64
  187. #define MIDL_uhyper  unsigned __int64
  188. #else
  189. typedef double  hyper;
  190. typedef double MIDL_uhyper;
  191. #endif
  192.  
  193. #endif // _HYPER_DEFINED
  194.  
  195. #ifndef _WCHAR_T_DEFINED
  196. typedef unsigned short wchar_t;
  197. #define _WCHAR_T_DEFINED
  198. #endif
  199.  
  200. #ifndef _SIZE_T_DEFINED
  201. typedef unsigned int size_t;
  202. #define _SIZE_T_DEFINED
  203. #endif
  204.  
  205. #ifdef __RPC_DOS__
  206. #define __RPC_CALLEE       __far __pascal
  207. #endif
  208.  
  209. #ifdef __RPC_WIN16__
  210. #define __RPC_CALLEE       __far __pascal __export
  211. #endif
  212.  
  213. #ifdef __RPC_WIN32__
  214. #if   (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  215. #define __RPC_CALLEE       __stdcall
  216. #else
  217. #define __RPC_CALLEE
  218. #endif
  219. #endif
  220.  
  221. #ifdef __RPC_MAC__
  222. #define __RPC_CALLEE __far
  223. #endif
  224.  
  225. #ifndef __MIDL_USER_DEFINED
  226. #define midl_user_allocate MIDL_user_allocate
  227. #define midl_user_free     MIDL_user_free
  228. #define __MIDL_USER_DEFINED
  229. #endif
  230.  
  231. void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
  232. void             __RPC_USER MIDL_user_free( void __RPC_FAR * );
  233.  
  234. #ifdef __RPC_WIN16__
  235. #define RPC_VAR_ENTRY __export __cdecl
  236. #else
  237. #define RPC_VAR_ENTRY __cdecl
  238. #endif
  239.  
  240.  
  241. /* winnt only */
  242. #if defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA)
  243. #define __MIDL_DECLSPEC_DLLIMPORT   __declspec(dllimport)
  244. #define __MIDL_DECLSPEC_DLLEXPORT   __declspec(dllexport)
  245. #else
  246. #define __MIDL_DECLSPEC_DLLIMPORT
  247. #define __MIDL_DECLSPEC_DLLEXPORT
  248. #endif
  249.  
  250.  
  251.  
  252.  
  253. /****************************************************************************
  254.  * Context handle management related definitions:
  255.  *
  256.  * Client and Server Contexts.
  257.  *
  258.  ****************************************************************************/
  259.  
  260. typedef void __RPC_FAR * NDR_CCONTEXT;
  261.  
  262. typedef struct
  263.     {
  264.     void __RPC_FAR * pad[2];
  265.     void __RPC_FAR * userContext;
  266.     } __RPC_FAR * NDR_SCONTEXT;
  267.  
  268. #define NDRSContextValue(hContext) (&(hContext)->userContext)
  269.  
  270. #define cbNDRContext 20         /* size of context on WIRE */
  271.  
  272. typedef void (__RPC_USER __RPC_FAR * NDR_RUNDOWN)(void __RPC_FAR * context);
  273.  
  274. typedef struct _SCONTEXT_QUEUE {
  275.     unsigned long   NumberOfObjects;
  276.     NDR_SCONTEXT  * ArrayOfObjects;
  277.     } SCONTEXT_QUEUE, __RPC_FAR * PSCONTEXT_QUEUE;
  278.  
  279. RPCRTAPI
  280. RPC_BINDING_HANDLE
  281. RPC_ENTRY
  282. NDRCContextBinding (
  283.     IN NDR_CCONTEXT     CContext
  284.     );
  285.  
  286. RPCRTAPI
  287. void
  288. RPC_ENTRY
  289. NDRCContextMarshall (
  290.     IN  NDR_CCONTEXT    CContext,
  291.     OUT void __RPC_FAR *pBuff
  292.     );
  293.  
  294. RPCRTAPI
  295. void
  296. RPC_ENTRY
  297. NDRCContextUnmarshall (
  298.     OUT NDR_CCONTEXT __RPC_FAR *pCContext,
  299.     IN  RPC_BINDING_HANDLE      hBinding,
  300.     IN  void __RPC_FAR *        pBuff,
  301.     IN  unsigned long           DataRepresentation
  302.     );
  303.  
  304. RPCRTAPI
  305. void
  306. RPC_ENTRY
  307. NDRSContextMarshall (
  308.     IN  NDR_SCONTEXT    CContext,
  309.     OUT void __RPC_FAR *pBuff,
  310.     IN  NDR_RUNDOWN     userRunDownIn
  311.     );
  312.  
  313. RPCRTAPI
  314. NDR_SCONTEXT
  315. RPC_ENTRY
  316. NDRSContextUnmarshall (
  317.     IN  void __RPC_FAR *pBuff,
  318.     IN  unsigned long   DataRepresentation
  319.     );
  320.  
  321. RPCRTAPI
  322. void 
  323. RPC_ENTRY
  324. NDRSContextMarshallEx (
  325.     IN  RPC_BINDING_HANDLE  BindingHandle, 
  326.     IN  NDR_SCONTEXT        CContext,
  327.     OUT void __RPC_FAR     *pBuff,
  328.     IN  NDR_RUNDOWN         userRunDownIn
  329.     );
  330.  
  331. RPCRTAPI
  332. NDR_SCONTEXT 
  333. RPC_ENTRY
  334. NDRSContextUnmarshallEx (
  335.     IN  RPC_BINDING_HANDLE  BindingHandle, 
  336.     IN  void __RPC_FAR     *pBuff,
  337.     IN  unsigned long       DataRepresentation
  338.     );
  339.  
  340. RPCRTAPI
  341. void
  342. RPC_ENTRY
  343. RpcSsDestroyClientContext (
  344.     IN void __RPC_FAR * __RPC_FAR * ContextHandle
  345.     );
  346.  
  347.  
  348. /****************************************************************************
  349.     NDR conversion related definitions.
  350.  ****************************************************************************/
  351.  
  352. #define byte_from_ndr(source, target) \
  353.     { \
  354.     *(target) = *(*(char __RPC_FAR * __RPC_FAR *)&(source)->Buffer)++; \
  355.     }
  356.  
  357. #define byte_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  358.     { \
  359.     NDRcopy ( \
  360.         (((char __RPC_FAR *)(Target))+(LowerIndex)), \
  361.         (Source)->Buffer, \
  362.         (unsigned int)((UpperIndex)-(LowerIndex))); \
  363.     *(unsigned long __RPC_FAR *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  364.     }
  365.  
  366. #define boolean_from_ndr(source, target) \
  367.     { \
  368.     *(target) = *(*(char __RPC_FAR * __RPC_FAR *)&(source)->Buffer)++; \
  369.     }
  370.  
  371. #define boolean_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  372.     { \
  373.     NDRcopy ( \
  374.         (((char __RPC_FAR *)(Target))+(LowerIndex)), \
  375.         (Source)->Buffer, \
  376.         (unsigned int)((UpperIndex)-(LowerIndex))); \
  377.     *(unsigned long __RPC_FAR *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  378.     }
  379.  
  380. #define small_from_ndr(source, target) \
  381.     { \
  382.     *(target) = *(*(char __RPC_FAR * __RPC_FAR *)&(source)->Buffer)++; \
  383.     }
  384.  
  385. #define small_from_ndr_temp(source, target, format) \
  386.     { \
  387.     *(target) = *(*(char __RPC_FAR * __RPC_FAR *)(source))++; \
  388.     }
  389.  
  390. #define small_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  391.     { \
  392.     NDRcopy ( \
  393.         (((char __RPC_FAR *)(Target))+(LowerIndex)), \
  394.         (Source)->Buffer, \
  395.         (unsigned int)((UpperIndex)-(LowerIndex))); \
  396.     *(unsigned long __RPC_FAR *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  397.     }
  398.  
  399. /****************************************************************************
  400.     Platform specific mapping of c-runtime functions.
  401.  ****************************************************************************/
  402.  
  403. #ifdef __RPC_DOS__
  404. #define MIDL_ascii_strlen(string) \
  405.     _fstrlen(string)
  406. #define MIDL_ascii_strcpy(target,source) \
  407.     _fstrcpy(target,source)
  408. #define MIDL_memset(s,c,n) \
  409.     _fmemset(s,c,n)
  410. #endif
  411.  
  412. #ifdef __RPC_WIN16__
  413. #define MIDL_ascii_strlen(string) \
  414.     _fstrlen(string)
  415. #define MIDL_ascii_strcpy(target,source) \
  416.     _fstrcpy(target,source)
  417. #define MIDL_memset(s,c,n) \
  418.     _fmemset(s,c,n)
  419. #endif
  420.  
  421. #if defined(__RPC_WIN32__) || defined(__RPC_MAC__)
  422. #define MIDL_ascii_strlen(string) \
  423.     strlen(string)
  424. #define MIDL_ascii_strcpy(target,source) \
  425.     strcpy(target,source)
  426. #define MIDL_memset(s,c,n) \
  427.     memset(s,c,n)
  428. #endif
  429.  
  430. /****************************************************************************
  431.     Ndr Library helper function prototypes for MIDL 1.0 ndr functions.
  432.  ****************************************************************************/
  433.  
  434. RPCRTAPI
  435. void
  436. RPC_ENTRY
  437. NDRcopy (
  438.     IN void __RPC_FAR *pTarget,
  439.     IN void __RPC_FAR *pSource,
  440.     IN unsigned int size
  441.     );
  442.  
  443. RPCRTAPI
  444. size_t
  445. RPC_ENTRY
  446. MIDL_wchar_strlen (
  447.     IN wchar_t __RPC_FAR *   s
  448.     );
  449.  
  450. RPCRTAPI
  451. void
  452. RPC_ENTRY
  453. MIDL_wchar_strcpy (
  454.     OUT void __RPC_FAR *     t,
  455.     IN wchar_t __RPC_FAR *   s
  456.     );
  457.  
  458. RPCRTAPI
  459. void
  460. RPC_ENTRY
  461. char_from_ndr (
  462.     IN OUT PRPC_MESSAGE                           SourceMessage,
  463.     OUT unsigned char __RPC_FAR *                 Target
  464.     );
  465.  
  466. RPCRTAPI
  467. void
  468. RPC_ENTRY
  469. char_array_from_ndr (
  470.     IN OUT PRPC_MESSAGE                           SourceMessage,
  471.     IN unsigned long                              LowerIndex,
  472.     IN unsigned long                              UpperIndex,
  473.     OUT unsigned char __RPC_FAR *                 Target
  474.     );
  475.  
  476. RPCRTAPI
  477. void
  478. RPC_ENTRY
  479. short_from_ndr (
  480.     IN OUT PRPC_MESSAGE                           source,
  481.     OUT unsigned short __RPC_FAR *                target
  482.     );
  483.  
  484. RPCRTAPI
  485. void
  486. RPC_ENTRY
  487. short_array_from_ndr(
  488.     IN OUT PRPC_MESSAGE                           SourceMessage,
  489.     IN unsigned long                              LowerIndex,
  490.     IN unsigned long                              UpperIndex,
  491.     OUT unsigned short __RPC_FAR *                Target
  492.     );
  493.  
  494. RPCRTAPI
  495. void
  496. RPC_ENTRY
  497. short_from_ndr_temp (
  498.     IN OUT unsigned char __RPC_FAR * __RPC_FAR *  source,
  499.     OUT unsigned short __RPC_FAR *                target,
  500.     IN unsigned long                              format
  501.     );
  502.  
  503. RPCRTAPI
  504. void
  505. RPC_ENTRY
  506. long_from_ndr (
  507.     IN OUT PRPC_MESSAGE                           source,
  508.     OUT unsigned long __RPC_FAR *                 target
  509.     );
  510.  
  511. RPCRTAPI
  512. void
  513. RPC_ENTRY
  514. long_array_from_ndr(
  515.     IN OUT PRPC_MESSAGE                           SourceMessage,
  516.     IN unsigned long                              LowerIndex,
  517.     IN unsigned long                              UpperIndex,
  518.     OUT unsigned long __RPC_FAR *                 Target
  519.     );
  520.  
  521. RPCRTAPI
  522. void
  523. RPC_ENTRY
  524. long_from_ndr_temp (
  525.     IN OUT unsigned char __RPC_FAR * __RPC_FAR *  source,
  526.     OUT unsigned long __RPC_FAR *                 target,
  527.     IN unsigned long                              format
  528.     );
  529.  
  530. RPCRTAPI
  531. void
  532. RPC_ENTRY
  533. enum_from_ndr(
  534.     IN OUT PRPC_MESSAGE                           SourceMessage,
  535.     OUT unsigned int __RPC_FAR *                  Target
  536.     );
  537.  
  538. RPCRTAPI
  539. void
  540. RPC_ENTRY
  541. float_from_ndr (
  542.     IN OUT PRPC_MESSAGE                           SourceMessage,
  543.     OUT void __RPC_FAR *                          Target
  544.     );
  545.  
  546. RPCRTAPI
  547. void
  548. RPC_ENTRY
  549. float_array_from_ndr (
  550.     IN OUT PRPC_MESSAGE                           SourceMessage,
  551.     IN unsigned long                              LowerIndex,
  552.     IN unsigned long                              UpperIndex,
  553.     OUT void __RPC_FAR *                          Target
  554.     );
  555.  
  556. RPCRTAPI
  557. void
  558. RPC_ENTRY
  559. double_from_ndr (
  560.     IN OUT PRPC_MESSAGE                           SourceMessage,
  561.     OUT void __RPC_FAR *                          Target
  562.     );
  563.  
  564. RPCRTAPI
  565. void
  566. RPC_ENTRY
  567. double_array_from_ndr (
  568.     IN OUT PRPC_MESSAGE                           SourceMessage,
  569.     IN unsigned long                              LowerIndex,
  570.     IN unsigned long                              UpperIndex,
  571.     OUT void __RPC_FAR *                          Target
  572.     );
  573.  
  574. RPCRTAPI
  575. void
  576. RPC_ENTRY
  577. hyper_from_ndr (
  578.     IN OUT PRPC_MESSAGE                           source,
  579.     OUT    hyper __RPC_FAR *                      target
  580.     );
  581.  
  582. RPCRTAPI
  583. void
  584. RPC_ENTRY
  585. hyper_array_from_ndr(
  586.     IN OUT PRPC_MESSAGE                           SourceMessage,
  587.     IN unsigned long                              LowerIndex,
  588.     IN unsigned long                              UpperIndex,
  589.     OUT          hyper __RPC_FAR *                Target
  590.     );
  591.  
  592. RPCRTAPI
  593. void
  594. RPC_ENTRY
  595. hyper_from_ndr_temp (
  596.     IN OUT unsigned char __RPC_FAR * __RPC_FAR *  source,
  597.     OUT             hyper __RPC_FAR *             target,
  598.     IN   unsigned   long                          format
  599.     );
  600.  
  601. RPCRTAPI
  602. void
  603. RPC_ENTRY
  604. data_from_ndr (
  605.     PRPC_MESSAGE                                  source,
  606.     void __RPC_FAR *                              target,
  607.     char __RPC_FAR *                              format,
  608.     unsigned char                                 MscPak
  609.     );
  610.  
  611. RPCRTAPI
  612. void
  613. RPC_ENTRY
  614. data_into_ndr (
  615.     void __RPC_FAR *                              source,
  616.     PRPC_MESSAGE                                  target,
  617.     char __RPC_FAR *                              format,
  618.     unsigned char                                 MscPak
  619.     );
  620.  
  621. RPCRTAPI
  622. void
  623. RPC_ENTRY
  624. tree_into_ndr (
  625.     void __RPC_FAR *                              source,
  626.     PRPC_MESSAGE                                  target,
  627.     char __RPC_FAR *                              format,
  628.     unsigned char                                 MscPak
  629.     );
  630.  
  631. RPCRTAPI
  632. void
  633. RPC_ENTRY
  634. data_size_ndr (
  635.     void __RPC_FAR *                              source,
  636.     PRPC_MESSAGE                                  target,
  637.     char __RPC_FAR *                              format,
  638.     unsigned char                                 MscPak
  639.     );
  640.  
  641. RPCRTAPI
  642. void
  643. RPC_ENTRY
  644. tree_size_ndr (
  645.     void __RPC_FAR *                              source,
  646.     PRPC_MESSAGE                                  target,
  647.     char __RPC_FAR *                              format,
  648.     unsigned char                                 MscPak
  649.     );
  650.  
  651. RPCRTAPI
  652. void
  653. RPC_ENTRY
  654. tree_peek_ndr (
  655.     PRPC_MESSAGE                                  source,
  656.     unsigned char __RPC_FAR * __RPC_FAR *         buffer,
  657.     char __RPC_FAR *                              format,
  658.     unsigned char                                 MscPak
  659.     );
  660.  
  661. RPCRTAPI
  662. void __RPC_FAR *
  663. RPC_ENTRY
  664. midl_allocate (
  665.     size_t      size
  666.     );
  667.  
  668. /****************************************************************************
  669.     MIDL 2.0 ndr definitions.
  670.  ****************************************************************************/
  671.  
  672. typedef unsigned long error_status_t;
  673.  
  674. #define _midl_ma1( p, cast )    *(*( cast **)&p)++
  675. #define _midl_ma2( p, cast )    *(*( cast **)&p)++
  676. #define _midl_ma4( p, cast )    *(*( cast **)&p)++
  677. #define _midl_ma8( p, cast )    *(*( cast **)&p)++
  678.  
  679. #define _midl_unma1( p, cast )  *(( cast *)p)++
  680. #define _midl_unma2( p, cast )  *(( cast *)p)++
  681. #define _midl_unma3( p, cast )  *(( cast *)p)++
  682. #define _midl_unma4( p, cast )  *(( cast *)p)++
  683.  
  684. // Some alignment specific macros.
  685.  
  686.  
  687. #define _midl_fa2( p )          (p = (RPC_BUFPTR )((unsigned long)(p+1) & 0xfffffffe))
  688. #define _midl_fa4( p )          (p = (RPC_BUFPTR )((unsigned long)(p+3) & 0xfffffffc))
  689. #define _midl_fa8( p )          (p = (RPC_BUFPTR )((unsigned long)(p+7) & 0xfffffff8))
  690.  
  691. #define _midl_addp( p, n )      (p += n)
  692.  
  693. // Marshalling macros
  694.  
  695. #define _midl_marsh_lhs( p, cast )  *(*( cast **)&p)++
  696. #define _midl_marsh_up( mp, p )     *(*(unsigned long **)&mp)++ = (unsigned long)p
  697. #define _midl_advmp( mp )           *(*(unsigned long **)&mp)++
  698. #define _midl_unmarsh_up( p )       (*(*(unsigned long **)&p)++)
  699.  
  700.  
  701. ////////////////////////////////////////////////////////////////////////////
  702. // Ndr macros.
  703. ////////////////////////////////////////////////////////////////////////////
  704.  
  705. #define NdrMarshConfStringHdr( p, s, l )    (_midl_ma4( p, unsigned long) = s, \
  706.                                             _midl_ma4( p, unsigned long) = 0, \
  707.                                             _midl_ma4( p, unsigned long) = l)
  708.  
  709. #define NdrUnMarshConfStringHdr(p, s, l)    ((s=_midl_unma4(p,unsigned long),\
  710.                                             (_midl_addp(p,4)),               \
  711.                                             (l=_midl_unma4(p,unsigned long))
  712.  
  713. #define NdrMarshCCtxtHdl(pc,p)  (NDRCContextMarshall( (NDR_CCONTEXT)pc, p ),p+20)
  714.  
  715. #define NdrUnMarshCCtxtHdl(pc,p,h,drep) \
  716.         (NDRCContextUnmarshall((NDR_CONTEXT)pc,h,p,drep), p+20)
  717.  
  718. #define NdrUnMarshSCtxtHdl(pc, p,drep)  (pc = NdrSContextUnMarshall(p,drep ))
  719.  
  720.  
  721. #define NdrMarshSCtxtHdl(pc,p,rd)   (NdrSContextMarshall((NDR_SCONTEXT)pc,p, (NDR_RUNDOWN)rd)
  722.  
  723. #define NdrFieldOffset(s,f)     (long)(& (((s __RPC_FAR *)0)->f))
  724. #define NdrFieldPad(s,f,p,t)    (NdrFieldOffset(s,f) - NdrFieldOffset(s,p) - sizeof(t))
  725.  
  726. #if defined(__RPC_MAC__)
  727. #define NdrFcShort(s)   (unsigned char)(s >> 8), (unsigned char)(s & 0xff)
  728. #define NdrFcLong(s)    (unsigned char)(s >> 24), (unsigned char)((s & 0x00ff0000) >> 16), \
  729.                         (unsigned char)((s & 0x0000ff00) >> 8), (unsigned char)(s & 0xff)
  730. #else
  731. #define NdrFcShort(s)   (unsigned char)(s & 0xff), (unsigned char)(s >> 8)
  732. #define NdrFcLong(s)    (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \
  733.                         (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
  734. #endif //  Mac
  735.  
  736. //
  737. // On the server side, the following exceptions are mapped to
  738. // the bad stub data exception if -error stub_data is used.
  739. //
  740.  
  741. #define RPC_BAD_STUB_DATA_EXCEPTION_FILTER  \
  742.                  ( (RpcExceptionCode() == STATUS_ACCESS_VIOLATION)  || \
  743.                    (RpcExceptionCode() == STATUS_DATATYPE_MISALIGNMENT) || \
  744.                    (RpcExceptionCode() == RPC_X_BAD_STUB_DATA) )
  745.  
  746. /////////////////////////////////////////////////////////////////////////////
  747. // Some stub helper functions.
  748. /////////////////////////////////////////////////////////////////////////////
  749.  
  750. ////////////////////////////////////////////////////////////////////////////
  751. // Stub helper structures.
  752. ////////////////////////////////////////////////////////////////////////////
  753.  
  754. struct _MIDL_STUB_MESSAGE;
  755. struct _MIDL_STUB_DESC;
  756. struct _FULL_PTR_XLAT_TABLES;
  757.  
  758. typedef unsigned char __RPC_FAR * RPC_BUFPTR;
  759. typedef unsigned long             RPC_LENGTH;
  760.  
  761. // Expression evaluation callback routine prototype.
  762. typedef void (__RPC_USER __RPC_FAR * EXPR_EVAL)( struct _MIDL_STUB_MESSAGE __RPC_FAR * );
  763.  
  764. typedef const unsigned char __RPC_FAR * PFORMAT_STRING;
  765.  
  766. /*
  767.  * Multidimensional conformant/varying array struct.
  768.  */
  769. typedef struct
  770.     {
  771.     long                            Dimension;
  772.  
  773.     /* These fields MUST be (unsigned long *) */
  774.     unsigned long __RPC_FAR *       BufferConformanceMark;
  775.     unsigned long __RPC_FAR *       BufferVarianceMark;
  776.  
  777.     /* Count arrays, used for top level arrays in -Os stubs */
  778.     unsigned long __RPC_FAR *       MaxCountArray;
  779.     unsigned long __RPC_FAR *       OffsetArray;
  780.     unsigned long __RPC_FAR *       ActualCountArray;
  781.     } ARRAY_INFO, __RPC_FAR *PARRAY_INFO;
  782.  
  783. /*
  784.  *  Pipe related definitions.
  785.  */
  786.  
  787. typedef struct _NDR_PIPE_DESC *       PNDR_PIPE_DESC;
  788. typedef struct _NDR_PIPE_MESSAGE *    PNDR_PIPE_MESSAGE;
  789.  
  790. typedef struct _NDR_ASYNC_MESSAGE *   PNDR_ASYNC_MESSAGE;
  791.  
  792. /*
  793.  * MIDL Stub Message
  794.  */
  795. #if !defined(__RPC_DOS__) && !defined(__RPC_WIN16__) && !defined(__RPC_MAC__)
  796. #include <pshpack4.h>
  797. #endif
  798.  
  799. typedef struct _MIDL_STUB_MESSAGE
  800.     {
  801.     /* RPC message structure. */
  802.     PRPC_MESSAGE                RpcMsg;
  803.  
  804.     /* Pointer into RPC message buffer. */
  805.     unsigned char __RPC_FAR *   Buffer;
  806.  
  807.     /*
  808.      * These are used internally by the Ndr routines to mark the beginning
  809.      * and end of an incoming RPC buffer.
  810.      */
  811.     unsigned char __RPC_FAR *   BufferStart;
  812.     unsigned char __RPC_FAR *   BufferEnd;
  813.  
  814.     /*
  815.      * Used internally by the Ndr routines as a place holder in the buffer.
  816.      * On the marshalling side it's used to mark the location where conformance
  817.      * size should be marshalled.
  818.      * On the unmarshalling side it's used to mark the location in the buffer
  819.      * used during pointer unmarshalling to base pointer offsets off of.
  820.      */
  821.     unsigned char __RPC_FAR *   BufferMark;
  822.  
  823.     /* Set by the buffer sizing routines. */
  824.     unsigned long               BufferLength;
  825.  
  826.     /* Set by the memory sizing routines. */
  827.     unsigned long               MemorySize;
  828.  
  829.     /* Pointer to user memory. */
  830.     unsigned char __RPC_FAR *   Memory;
  831.  
  832.     /* Is the Ndr routine begin called from a client side stub. */
  833.     int                         IsClient;
  834.  
  835.     /* Can the buffer be re-used for memory on unmarshalling. */
  836.     int                         ReuseBuffer;
  837.  
  838.     /* Holds the current pointer to an allocate all nodes memory block. */
  839.     unsigned char __RPC_FAR *   AllocAllNodesMemory;
  840.  
  841.     /* Used for debugging asserts only, remove later. */
  842.     unsigned char __RPC_FAR *   AllocAllNodesMemoryEnd;
  843.  
  844.     /*
  845.      * Stuff needed while handling complex structures
  846.      */
  847.  
  848.     /* Ignore imbeded pointers while computing buffer or memory sizes. */
  849.     int                         IgnoreEmbeddedPointers;
  850.  
  851.     /*
  852.      * This marks the location in the buffer where pointees of a complex
  853.      * struct reside.
  854.      */
  855.     unsigned char __RPC_FAR *   PointerBufferMark;
  856.  
  857.     /*
  858.      * Used to catch errors in SendReceive.
  859.      */
  860.     unsigned char               fBufferValid;
  861.  
  862.     /*
  863.      * Obsolete unused field (formerly MaxContextHandleNumber).
  864.      */
  865.     unsigned char               Unused;
  866.  
  867.     /*
  868.      * Used internally by the Ndr routines.  Holds the max counts for
  869.      * a conformant array.
  870.      */
  871.     unsigned long               MaxCount;
  872.  
  873.     /*
  874.      * Used internally by the Ndr routines.  Holds the offsets for a varying
  875.      * array.
  876.      */
  877.     unsigned long               Offset;
  878.  
  879.     /*
  880.      * Used internally by the Ndr routines.  Holds the actual counts for
  881.      * a varying array.
  882.      */
  883.     unsigned long               ActualCount;
  884.  
  885.     /* Allocation and Free routine to be used by the Ndr routines. */
  886.     void __RPC_FAR *    (__RPC_FAR __RPC_API * pfnAllocate)(size_t);
  887.     void                (__RPC_FAR __RPC_API * pfnFree)(void __RPC_FAR *);
  888.  
  889.     /*
  890.      * Top of parameter stack.  Used for "single call" stubs during marshalling
  891.      * to hold the beginning of the parameter list on the stack.  Needed to
  892.      * extract parameters which hold attribute values for top level arrays and
  893.      * pointers.
  894.      */
  895.     unsigned char __RPC_FAR *       StackTop;
  896.  
  897.     /*
  898.      *  Fields used for the transmit_as and represent_as objects.
  899.      *  For represent_as the mapping is: presented=local, transmit=named.
  900.      */
  901.     unsigned char __RPC_FAR *       pPresentedType;
  902.     unsigned char __RPC_FAR *       pTransmitType;
  903.  
  904.     /*
  905.      * When we first construct a binding on the client side, stick it
  906.      * in the rpcmessage and later call RpcGetBuffer, the handle field
  907.      * in the rpcmessage is changed. That's fine except that we need to
  908.      * have that original handle for use in unmarshalling context handles
  909.      * (the second argument in NDRCContextUnmarshall to be exact). So
  910.      * stash the contructed handle here and extract it when needed.
  911.      */
  912.     handle_t                        SavedHandle;
  913.  
  914.     /*
  915.      * Pointer back to the stub descriptor.  Use this to get all handle info.
  916.      */
  917.     const struct _MIDL_STUB_DESC __RPC_FAR *    StubDesc;
  918.  
  919.     /*
  920.      * Full pointer stuff.
  921.      */
  922.     struct _FULL_PTR_XLAT_TABLES __RPC_FAR *    FullPtrXlatTables;
  923.  
  924.     unsigned long                   FullPtrRefId;
  925.  
  926.     /*
  927.      * flags
  928.      */
  929.  
  930.     int                             fCheckBounds;
  931.  
  932.     int                             fInDontFree       :1;
  933.     int                             fDontCallFreeInst :1;
  934.     int                             fInOnlyParam      :1;
  935.     int                             fHasReturn        :1;
  936.  
  937.     unsigned long                   dwDestContext;
  938.     void __RPC_FAR *                pvDestContext;
  939.  
  940.     NDR_SCONTEXT *                  SavedContextHandles;
  941.  
  942.     long                            ParamNumber;
  943.  
  944.     struct IRpcChannelBuffer __RPC_FAR *    pRpcChannelBuffer;
  945.  
  946.     PARRAY_INFO                     pArrayInfo;
  947.  
  948.     /*
  949.      * This is where the Beta2 stub message ends.
  950.      */
  951.  
  952.     unsigned long __RPC_FAR *       SizePtrCountArray;
  953.     unsigned long __RPC_FAR *       SizePtrOffsetArray;
  954.     unsigned long __RPC_FAR *       SizePtrLengthArray;
  955.  
  956.     /*
  957.      * Interpreter argument queue.  Used on server side only.
  958.      */
  959.     void __RPC_FAR *                pArgQueue;
  960.  
  961.     unsigned long                   dwStubPhase;
  962.  
  963.     /*
  964.      * Pipe descriptor, defined for the 4.0 release.
  965.      */
  966.     PNDR_PIPE_DESC                  pPipeDesc;
  967.  
  968.     /*
  969.      *  Async message pointer, an NT 5.0 feature.
  970.      */
  971.     PNDR_ASYNC_MESSAGE              pAsyncMsg;
  972.  
  973.     unsigned long                   Reserved[3];
  974.  
  975.     /*
  976.      *  Fields up to this point present since the 3.50 release.
  977.      */
  978.  
  979.     } MIDL_STUB_MESSAGE, __RPC_FAR *PMIDL_STUB_MESSAGE;
  980.  
  981. #if !defined(__RPC_DOS__) && !defined(__RPC_WIN16__) && !defined(__RPC_MAC__)
  982. #include <poppack.h>
  983. #endif
  984.  
  985. /*
  986.  * Generic handle bind/unbind routine pair.
  987.  */
  988. typedef void __RPC_FAR *
  989.         (__RPC_FAR __RPC_API * GENERIC_BINDING_ROUTINE)
  990.         (void __RPC_FAR *);
  991. typedef void
  992.         (__RPC_FAR __RPC_API * GENERIC_UNBIND_ROUTINE)
  993.         (void __RPC_FAR *, unsigned char __RPC_FAR *);
  994.  
  995. typedef struct _GENERIC_BINDING_ROUTINE_PAIR
  996.     {
  997.     GENERIC_BINDING_ROUTINE     pfnBind;
  998.     GENERIC_UNBIND_ROUTINE      pfnUnbind;
  999.     } GENERIC_BINDING_ROUTINE_PAIR, __RPC_FAR *PGENERIC_BINDING_ROUTINE_PAIR;
  1000.  
  1001. typedef struct __GENERIC_BINDING_INFO
  1002.     {
  1003.     void __RPC_FAR *            pObj;
  1004.     unsigned int                Size;
  1005.     GENERIC_BINDING_ROUTINE     pfnBind;
  1006.     GENERIC_UNBIND_ROUTINE      pfnUnbind;
  1007.     } GENERIC_BINDING_INFO, __RPC_FAR *PGENERIC_BINDING_INFO;
  1008.  
  1009. // typedef EXPR_EVAL - see above
  1010. // typedefs for xmit_as
  1011.  
  1012. #if (defined(_MSC_VER)) && !defined(MIDL_PASS)
  1013. // a Microsoft C++ compiler
  1014. #define NDR_SHAREABLE __inline
  1015. #else
  1016. #define NDR_SHAREABLE static
  1017. #endif
  1018.  
  1019.  
  1020. typedef void (__RPC_FAR __RPC_USER * XMIT_HELPER_ROUTINE)
  1021.     ( PMIDL_STUB_MESSAGE );
  1022.  
  1023. typedef struct _XMIT_ROUTINE_QUINTUPLE
  1024.     {
  1025.     XMIT_HELPER_ROUTINE     pfnTranslateToXmit;
  1026.     XMIT_HELPER_ROUTINE     pfnTranslateFromXmit;
  1027.     XMIT_HELPER_ROUTINE     pfnFreeXmit;
  1028.     XMIT_HELPER_ROUTINE     pfnFreeInst;
  1029.     } XMIT_ROUTINE_QUINTUPLE, __RPC_FAR *PXMIT_ROUTINE_QUINTUPLE;
  1030.  
  1031. typedef unsigned long
  1032. (__RPC_FAR __RPC_USER * USER_MARSHAL_SIZING_ROUTINE)
  1033.     (unsigned long __RPC_FAR *,
  1034.      unsigned long,
  1035.      void __RPC_FAR * );
  1036.  
  1037. typedef unsigned char __RPC_FAR *
  1038. (__RPC_FAR __RPC_USER * USER_MARSHAL_MARSHALLING_ROUTINE)
  1039.     (unsigned long __RPC_FAR *,
  1040.      unsigned char  __RPC_FAR * ,
  1041.      void __RPC_FAR * );
  1042.  
  1043. typedef unsigned char __RPC_FAR *
  1044. (__RPC_FAR __RPC_USER * USER_MARSHAL_UNMARSHALLING_ROUTINE)
  1045.     (unsigned long __RPC_FAR *,
  1046.      unsigned char  __RPC_FAR * ,
  1047.      void __RPC_FAR * );
  1048.  
  1049. typedef void (__RPC_FAR __RPC_USER * USER_MARSHAL_FREEING_ROUTINE)
  1050.     (unsigned long __RPC_FAR *,
  1051.      void __RPC_FAR * );
  1052.  
  1053. typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE
  1054.     {
  1055.     USER_MARSHAL_SIZING_ROUTINE          pfnBufferSize;
  1056.     USER_MARSHAL_MARSHALLING_ROUTINE     pfnMarshall;
  1057.     USER_MARSHAL_UNMARSHALLING_ROUTINE   pfnUnmarshall;
  1058.     USER_MARSHAL_FREEING_ROUTINE         pfnFree;
  1059.     } USER_MARSHAL_ROUTINE_QUADRUPLE;
  1060.  
  1061. typedef struct _USER_MARSHAL_CB
  1062. {
  1063.     unsigned long       Flags;
  1064.     PMIDL_STUB_MESSAGE  pStubMsg;
  1065.     PFORMAT_STRING      pReserve;
  1066. } USER_MARSHAL_CB;
  1067.  
  1068.  
  1069. #define USER_CALL_CTXT_MASK(f)  ((f) & 0x00ff)
  1070. #define USER_CALL_AUX_MASK(f)   ((f) & 0xff00)
  1071. #define GET_USER_DATA_REP(f)    ((f) >> 16)
  1072.  
  1073. #define USER_CALL_IS_ASYNC      0x0100      /* aux flag: in an [async] call */
  1074.  
  1075.  
  1076. typedef struct _MALLOC_FREE_STRUCT
  1077.     {
  1078.     void __RPC_FAR *    (__RPC_FAR __RPC_USER * pfnAllocate)(size_t);
  1079.     void                (__RPC_FAR __RPC_USER * pfnFree)(void __RPC_FAR *);
  1080.     } MALLOC_FREE_STRUCT;
  1081.  
  1082. typedef struct _COMM_FAULT_OFFSETS
  1083.     {
  1084.     short       CommOffset;
  1085.     short       FaultOffset;
  1086.     } COMM_FAULT_OFFSETS;
  1087.  
  1088. /*
  1089.  * MIDL Stub Descriptor
  1090.  */
  1091.  
  1092. typedef struct _MIDL_STUB_DESC
  1093.     {
  1094.  
  1095.     void __RPC_FAR *    RpcInterfaceInformation;
  1096.  
  1097.     void __RPC_FAR *    (__RPC_FAR __RPC_API * pfnAllocate)(size_t);
  1098.     void                (__RPC_FAR __RPC_API * pfnFree)(void __RPC_FAR *);
  1099.  
  1100.     union
  1101.         {
  1102.         handle_t __RPC_FAR *            pAutoHandle;
  1103.         handle_t __RPC_FAR *            pPrimitiveHandle;
  1104.         PGENERIC_BINDING_INFO           pGenericBindingInfo;
  1105.         } IMPLICIT_HANDLE_INFO;
  1106.  
  1107.     const NDR_RUNDOWN __RPC_FAR *                   apfnNdrRundownRoutines;
  1108.     const GENERIC_BINDING_ROUTINE_PAIR __RPC_FAR *  aGenericBindingRoutinePairs;
  1109.  
  1110.     const EXPR_EVAL __RPC_FAR *                     apfnExprEval;
  1111.  
  1112.     const XMIT_ROUTINE_QUINTUPLE __RPC_FAR *        aXmitQuintuple;
  1113.  
  1114.     const unsigned char __RPC_FAR *                 pFormatTypes;
  1115.  
  1116.     int                                             fCheckBounds;
  1117.  
  1118.     /* Ndr library version. */
  1119.     unsigned long                                   Version;
  1120.  
  1121.     /*
  1122.      * Reserved for future use. (no reserves )
  1123.      */
  1124.  
  1125.     MALLOC_FREE_STRUCT __RPC_FAR *                  pMallocFreeStruct;
  1126.  
  1127.     long                                MIDLVersion;
  1128.  
  1129.     const COMM_FAULT_OFFSETS __RPC_FAR *    CommFaultOffsets;
  1130.  
  1131.     // New fields for version 3.0+
  1132.  
  1133.     const USER_MARSHAL_ROUTINE_QUADRUPLE __RPC_FAR * aUserMarshalQuadruple;
  1134.  
  1135.     long                                    Reserved1;
  1136.     long                                    Reserved2;
  1137.     long                                    Reserved3;
  1138.     long                                    Reserved4;
  1139.     long                                    Reserved5;
  1140.  
  1141.     } MIDL_STUB_DESC;
  1142.  
  1143. typedef const MIDL_STUB_DESC __RPC_FAR * PMIDL_STUB_DESC;
  1144.  
  1145. typedef void __RPC_FAR * PMIDL_XMIT_TYPE;
  1146.  
  1147. /*
  1148.  * MIDL Stub Format String.  This is a const in the stub.
  1149.  */
  1150. #if !defined( RC_INVOKED )
  1151. #pragma warning( disable:4200 )
  1152. #endif
  1153. typedef struct _MIDL_FORMAT_STRING
  1154.     {
  1155.     short               Pad;
  1156.     unsigned char       Format[];
  1157.     } MIDL_FORMAT_STRING;
  1158. #if !defined( RC_INVOKED )
  1159. #pragma warning( default:4200 )
  1160. #endif
  1161.  
  1162. /*
  1163.  * Stub thunk used for some interpreted server stubs.
  1164.  */
  1165. typedef void (__RPC_FAR __RPC_API * STUB_THUNK)( PMIDL_STUB_MESSAGE );
  1166.  
  1167. typedef long (__RPC_FAR __RPC_API * SERVER_ROUTINE)();
  1168.  
  1169. /*
  1170.  * Server Interpreter's information strucuture.
  1171.  */
  1172. typedef struct  _MIDL_SERVER_INFO_
  1173.     {
  1174.     PMIDL_STUB_DESC             pStubDesc;
  1175.     const SERVER_ROUTINE *      DispatchTable;
  1176.     PFORMAT_STRING              ProcString;
  1177.     const unsigned short *      FmtStringOffset;
  1178.     const STUB_THUNK *          ThunkTable;
  1179.     PFORMAT_STRING              LocalFormatTypes;
  1180.     PFORMAT_STRING              LocalProcString;
  1181.     const unsigned short *      LocalFmtStringOffset;
  1182.     } MIDL_SERVER_INFO, *PMIDL_SERVER_INFO;
  1183.  
  1184. /*
  1185.  * Stubless object proxy information structure.
  1186.  */
  1187. typedef struct _MIDL_STUBLESS_PROXY_INFO
  1188.     {
  1189.     PMIDL_STUB_DESC                     pStubDesc;
  1190.     PFORMAT_STRING                      ProcFormatString;
  1191.     const unsigned short __RPC_FAR *    FormatStringOffset;
  1192.     PFORMAT_STRING                      LocalFormatTypes;
  1193.     PFORMAT_STRING                      LocalProcString;
  1194.     const unsigned short __RPC_FAR *    LocalFmtStringOffset;
  1195.     } MIDL_STUBLESS_PROXY_INFO;
  1196.  
  1197. typedef MIDL_STUBLESS_PROXY_INFO __RPC_FAR * PMIDL_STUBLESS_PROXY_INFO;
  1198.  
  1199. /*
  1200.  * This is the return value from NdrClientCall.
  1201.  */
  1202. typedef union _CLIENT_CALL_RETURN
  1203.     {
  1204.     void __RPC_FAR *        Pointer;
  1205.     long                    Simple;
  1206.     } CLIENT_CALL_RETURN;
  1207.  
  1208. /*
  1209.  * Full pointer data structures.
  1210.  */
  1211.  
  1212. typedef enum
  1213.         {
  1214.         XLAT_SERVER = 1,
  1215.         XLAT_CLIENT
  1216.         } XLAT_SIDE;
  1217.  
  1218. /*
  1219.  * Stores the translation for the conversion from a full pointer into it's
  1220.  * corresponding ref id.
  1221.  */
  1222. typedef struct _FULL_PTR_TO_REFID_ELEMENT
  1223.     {
  1224.     struct _FULL_PTR_TO_REFID_ELEMENT __RPC_FAR *  Next;
  1225.  
  1226.     void __RPC_FAR *            Pointer;
  1227.     unsigned long       RefId;
  1228.     unsigned char       State;
  1229.     } FULL_PTR_TO_REFID_ELEMENT, __RPC_FAR *PFULL_PTR_TO_REFID_ELEMENT;
  1230.  
  1231. /*
  1232.  * Full pointer translation tables.
  1233.  */
  1234. typedef struct _FULL_PTR_XLAT_TABLES
  1235.     {
  1236.     /*
  1237.      * Ref id to pointer translation information.
  1238.      */
  1239.     struct
  1240.         {
  1241.         void __RPC_FAR *__RPC_FAR *             XlatTable;
  1242.         unsigned char __RPC_FAR *     StateTable;
  1243.         unsigned long       NumberOfEntries;
  1244.         } RefIdToPointer;
  1245.  
  1246.     /*
  1247.      * Pointer to ref id translation information.
  1248.      */
  1249.     struct
  1250.         {
  1251.         PFULL_PTR_TO_REFID_ELEMENT __RPC_FAR *  XlatTable;
  1252.         unsigned long                   NumberOfBuckets;
  1253.         unsigned long                   HashMask;
  1254.         } PointerToRefId;
  1255.  
  1256.     /*
  1257.      * Next ref id to use.
  1258.      */
  1259.     unsigned long           NextRefId;
  1260.  
  1261.     /*
  1262.      * Keep track of the translation size we're handling : server or client.
  1263.      * This tells us when we have to do reverse translations when we insert
  1264.      * new translations.  On the server we must insert a pointer-to-refid
  1265.      * translation whenever we insert a refid-to-pointer translation, and
  1266.      * vica versa for the client.
  1267.      */
  1268.     XLAT_SIDE               XlatSide;
  1269.     } FULL_PTR_XLAT_TABLES, __RPC_FAR *PFULL_PTR_XLAT_TABLES;
  1270.  
  1271. /***************************************************************************
  1272.  ** New MIDL 2.0 Ndr routine templates
  1273.  ***************************************************************************/
  1274.  
  1275. /*
  1276.  * Marshall routines
  1277.  */
  1278.  
  1279. RPCRTAPI
  1280. void
  1281. RPC_ENTRY
  1282. NdrSimpleTypeMarshall(
  1283.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1284.     unsigned char __RPC_FAR *           pMemory,
  1285.     unsigned char                       FormatChar
  1286.     );
  1287.  
  1288. RPCRTAPI
  1289. unsigned char __RPC_FAR *
  1290. RPC_ENTRY
  1291. NdrPointerMarshall(
  1292.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1293.     unsigned char __RPC_FAR *           pMemory,
  1294.     PFORMAT_STRING                      pFormat
  1295.     );
  1296.  
  1297. /* Structures */
  1298.  
  1299. RPCRTAPI
  1300. unsigned char __RPC_FAR *
  1301. RPC_ENTRY
  1302. NdrSimpleStructMarshall(
  1303.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1304.     unsigned char __RPC_FAR *           pMemory,
  1305.     PFORMAT_STRING                      pFormat
  1306.     );
  1307.  
  1308. RPCRTAPI
  1309. unsigned char __RPC_FAR *
  1310. RPC_ENTRY
  1311. NdrConformantStructMarshall(
  1312.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1313.     unsigned char __RPC_FAR *           pMemory,
  1314.     PFORMAT_STRING                      pFormat
  1315.     );
  1316.  
  1317. RPCRTAPI
  1318. unsigned char __RPC_FAR *
  1319. RPC_ENTRY
  1320. NdrConformantVaryingStructMarshall(
  1321.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1322.     unsigned char __RPC_FAR *           pMemory,
  1323.     PFORMAT_STRING                      pFormat
  1324.     );
  1325.  
  1326. RPCRTAPI
  1327. unsigned char __RPC_FAR *
  1328. RPC_ENTRY
  1329. NdrHardStructMarshall(
  1330.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1331.     unsigned char __RPC_FAR *           pMemory,
  1332.     PFORMAT_STRING                      pFormat
  1333.     );
  1334.  
  1335. RPCRTAPI
  1336. unsigned char __RPC_FAR *
  1337. RPC_ENTRY
  1338. NdrComplexStructMarshall(
  1339.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1340.     unsigned char __RPC_FAR *           pMemory,
  1341.     PFORMAT_STRING                      pFormat
  1342.     );
  1343.  
  1344. /* Arrays */
  1345.  
  1346. RPCRTAPI
  1347. unsigned char __RPC_FAR *
  1348. RPC_ENTRY
  1349. NdrFixedArrayMarshall(
  1350.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1351.     unsigned char __RPC_FAR *           pMemory,
  1352.     PFORMAT_STRING                      pFormat
  1353.     );
  1354.  
  1355. RPCRTAPI
  1356. unsigned char __RPC_FAR *
  1357. RPC_ENTRY
  1358. NdrConformantArrayMarshall(
  1359.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1360.     unsigned char __RPC_FAR *           pMemory,
  1361.     PFORMAT_STRING                      pFormat
  1362.     );
  1363.  
  1364. RPCRTAPI
  1365. unsigned char __RPC_FAR *
  1366. RPC_ENTRY
  1367. NdrConformantVaryingArrayMarshall(
  1368.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1369.     unsigned char __RPC_FAR *           pMemory,
  1370.     PFORMAT_STRING                      pFormat
  1371.     );
  1372.  
  1373. RPCRTAPI
  1374. unsigned char __RPC_FAR *
  1375. RPC_ENTRY
  1376. NdrVaryingArrayMarshall(
  1377.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1378.     unsigned char __RPC_FAR *           pMemory,
  1379.     PFORMAT_STRING                      pFormat
  1380.     );
  1381.  
  1382. RPCRTAPI
  1383. unsigned char __RPC_FAR *
  1384. RPC_ENTRY
  1385. NdrComplexArrayMarshall(
  1386.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1387.     unsigned char __RPC_FAR *           pMemory,
  1388.     PFORMAT_STRING                      pFormat
  1389.     );
  1390.  
  1391. /* Strings */
  1392.  
  1393. RPCRTAPI
  1394. unsigned char __RPC_FAR *
  1395. RPC_ENTRY
  1396. NdrNonConformantStringMarshall(
  1397.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1398.     unsigned char __RPC_FAR *           pMemory,
  1399.     PFORMAT_STRING                      pFormat
  1400.     );
  1401.  
  1402. RPCRTAPI
  1403. unsigned char __RPC_FAR *
  1404. RPC_ENTRY
  1405. NdrConformantStringMarshall(
  1406.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1407.     unsigned char __RPC_FAR *           pMemory,
  1408.     PFORMAT_STRING                      pFormat
  1409.     );
  1410.  
  1411. /* Unions */
  1412.  
  1413. RPCRTAPI
  1414. unsigned char __RPC_FAR *
  1415. RPC_ENTRY
  1416. NdrEncapsulatedUnionMarshall(
  1417.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1418.     unsigned char __RPC_FAR *           pMemory,
  1419.     PFORMAT_STRING                      pFormat
  1420.     );
  1421.  
  1422. RPCRTAPI
  1423. unsigned char __RPC_FAR *
  1424. RPC_ENTRY
  1425. NdrNonEncapsulatedUnionMarshall(
  1426.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1427.     unsigned char __RPC_FAR *           pMemory,
  1428.     PFORMAT_STRING                      pFormat
  1429.     );
  1430.  
  1431. /* Byte count pointer */
  1432.  
  1433. RPCRTAPI
  1434. unsigned char __RPC_FAR *
  1435. RPC_ENTRY
  1436. NdrByteCountPointerMarshall(
  1437.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1438.     unsigned char __RPC_FAR *           pMemory,
  1439.     PFORMAT_STRING                      pFormat
  1440.     );
  1441.  
  1442. /* Transmit as and represent as*/
  1443.  
  1444. RPCRTAPI
  1445. unsigned char __RPC_FAR *
  1446. RPC_ENTRY
  1447. NdrXmitOrRepAsMarshall(
  1448.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1449.     unsigned char __RPC_FAR *           pMemory,
  1450.     PFORMAT_STRING                      pFormat
  1451.     );
  1452.  
  1453. /* User_marshal */
  1454.  
  1455. RPCRTAPI
  1456. unsigned char __RPC_FAR *
  1457. RPC_ENTRY
  1458. NdrUserMarshalMarshall(
  1459.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1460.     unsigned char __RPC_FAR *           pMemory,
  1461.     PFORMAT_STRING                      pFormat
  1462.     );
  1463.  
  1464. /* Cairo interface pointer */
  1465.  
  1466. RPCRTAPI
  1467. unsigned char __RPC_FAR *
  1468. RPC_ENTRY
  1469. NdrInterfacePointerMarshall(
  1470.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1471.     unsigned char __RPC_FAR *           pMemory,
  1472.     PFORMAT_STRING                      pFormat
  1473.     );
  1474.  
  1475. /* Context handles */
  1476.  
  1477. RPCRTAPI
  1478. void
  1479. RPC_ENTRY
  1480. NdrClientContextMarshall(
  1481.     PMIDL_STUB_MESSAGE    pStubMsg,
  1482.     NDR_CCONTEXT          ContextHandle,
  1483.     int                   fCheck
  1484.     );
  1485.  
  1486. RPCRTAPI
  1487. void
  1488. RPC_ENTRY
  1489. NdrServerContextMarshall(
  1490.     PMIDL_STUB_MESSAGE    pStubMsg,
  1491.     NDR_SCONTEXT          ContextHandle,
  1492.     NDR_RUNDOWN           RundownRoutine
  1493.     );
  1494.  
  1495. /*
  1496.  * Unmarshall routines
  1497.  */
  1498.  
  1499. RPCRTAPI
  1500. void
  1501. RPC_ENTRY
  1502. NdrSimpleTypeUnmarshall(
  1503.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1504.     unsigned char __RPC_FAR *           pMemory,
  1505.     unsigned char                       FormatChar
  1506.     );
  1507.  
  1508. RPCRTAPI
  1509. unsigned char __RPC_FAR *
  1510. RPC_ENTRY
  1511. NdrPointerUnmarshall(
  1512.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1513.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1514.     PFORMAT_STRING                          pFormat,
  1515.     unsigned char                           fMustAlloc
  1516.     );
  1517.  
  1518. /* Structures */
  1519.  
  1520. RPCRTAPI
  1521. unsigned char __RPC_FAR *
  1522. RPC_ENTRY
  1523. NdrSimpleStructUnmarshall(
  1524.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1525.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1526.     PFORMAT_STRING                          pFormat,
  1527.     unsigned char                           fMustAlloc
  1528.     );
  1529.  
  1530. RPCRTAPI
  1531. unsigned char __RPC_FAR *
  1532. RPC_ENTRY
  1533. NdrConformantStructUnmarshall(
  1534.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1535.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1536.     PFORMAT_STRING                          pFormat,
  1537.     unsigned char                           fMustAlloc
  1538.     );
  1539.  
  1540. RPCRTAPI
  1541. unsigned char __RPC_FAR *
  1542. RPC_ENTRY
  1543. NdrConformantVaryingStructUnmarshall(
  1544.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1545.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1546.     PFORMAT_STRING                          pFormat,
  1547.     unsigned char                           fMustAlloc
  1548.     );
  1549.  
  1550. RPCRTAPI
  1551. unsigned char __RPC_FAR *
  1552. RPC_ENTRY
  1553. NdrHardStructUnmarshall(
  1554.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1555.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1556.     PFORMAT_STRING                          pFormat,
  1557.     unsigned char                           fMustAlloc
  1558.     );
  1559.  
  1560. RPCRTAPI
  1561. unsigned char __RPC_FAR *
  1562. RPC_ENTRY
  1563. NdrComplexStructUnmarshall(
  1564.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1565.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1566.     PFORMAT_STRING                          pFormat,
  1567.     unsigned char                           fMustAlloc
  1568.     );
  1569.  
  1570. /* Arrays */
  1571.  
  1572. RPCRTAPI
  1573. unsigned char __RPC_FAR *
  1574. RPC_ENTRY
  1575. NdrFixedArrayUnmarshall(
  1576.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1577.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1578.     PFORMAT_STRING                          pFormat,
  1579.     unsigned char                           fMustAlloc
  1580.     );
  1581.  
  1582. RPCRTAPI
  1583. unsigned char __RPC_FAR *
  1584. RPC_ENTRY
  1585. NdrConformantArrayUnmarshall(
  1586.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1587.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1588.     PFORMAT_STRING                          pFormat,
  1589.     unsigned char                           fMustAlloc
  1590.     );
  1591.  
  1592. RPCRTAPI
  1593. unsigned char __RPC_FAR *
  1594. RPC_ENTRY
  1595. NdrConformantVaryingArrayUnmarshall(
  1596.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1597.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1598.     PFORMAT_STRING                          pFormat,
  1599.     unsigned char                           fMustAlloc
  1600.     );
  1601.  
  1602. RPCRTAPI
  1603. unsigned char __RPC_FAR *
  1604. RPC_ENTRY
  1605. NdrVaryingArrayUnmarshall(
  1606.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1607.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1608.     PFORMAT_STRING                          pFormat,
  1609.     unsigned char                           fMustAlloc
  1610.     );
  1611.  
  1612. RPCRTAPI
  1613. unsigned char __RPC_FAR *
  1614. RPC_ENTRY
  1615. NdrComplexArrayUnmarshall(
  1616.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1617.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1618.     PFORMAT_STRING                          pFormat,
  1619.     unsigned char                           fMustAlloc
  1620.     );
  1621.  
  1622. /* Strings */
  1623.  
  1624. RPCRTAPI
  1625. unsigned char __RPC_FAR *
  1626. RPC_ENTRY
  1627. NdrNonConformantStringUnmarshall(
  1628.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1629.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1630.     PFORMAT_STRING                          pFormat,
  1631.     unsigned char                           fMustAlloc
  1632.     );
  1633.  
  1634. RPCRTAPI
  1635. unsigned char __RPC_FAR *
  1636. RPC_ENTRY
  1637. NdrConformantStringUnmarshall(
  1638.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1639.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1640.     PFORMAT_STRING                          pFormat,
  1641.     unsigned char                           fMustAlloc
  1642.     );
  1643.  
  1644. /* Unions */
  1645.  
  1646. RPCRTAPI
  1647. unsigned char __RPC_FAR *
  1648. RPC_ENTRY
  1649. NdrEncapsulatedUnionUnmarshall(
  1650.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1651.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1652.     PFORMAT_STRING                          pFormat,
  1653.     unsigned char                           fMustAlloc
  1654.     );
  1655.  
  1656. RPCRTAPI
  1657. unsigned char __RPC_FAR *
  1658. RPC_ENTRY
  1659. NdrNonEncapsulatedUnionUnmarshall(
  1660.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1661.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1662.     PFORMAT_STRING                          pFormat,
  1663.     unsigned char                           fMustAlloc
  1664.     );
  1665.  
  1666. /* Byte count pointer */
  1667.  
  1668. RPCRTAPI
  1669. unsigned char __RPC_FAR *
  1670. RPC_ENTRY
  1671. NdrByteCountPointerUnmarshall(
  1672.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1673.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1674.     PFORMAT_STRING                          pFormat,
  1675.     unsigned char                           fMustAlloc
  1676.     );
  1677.  
  1678. /* Transmit as and represent as*/
  1679.  
  1680. RPCRTAPI
  1681. unsigned char __RPC_FAR *
  1682. RPC_ENTRY
  1683. NdrXmitOrRepAsUnmarshall(
  1684.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1685.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1686.     PFORMAT_STRING                          pFormat,
  1687.     unsigned char                           fMustAlloc
  1688.     );
  1689.  
  1690. /* User_marshal */
  1691.  
  1692. RPCRTAPI
  1693. unsigned char __RPC_FAR *
  1694. RPC_ENTRY
  1695. NdrUserMarshalUnmarshall(
  1696.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1697.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1698.     PFORMAT_STRING                          pFormat,
  1699.     unsigned char                           fMustAlloc
  1700.     );
  1701.  
  1702. /* Cairo interface pointer */
  1703.  
  1704. RPCRTAPI
  1705. unsigned char __RPC_FAR *
  1706. RPC_ENTRY
  1707. NdrInterfacePointerUnmarshall(
  1708.     PMIDL_STUB_MESSAGE                      pStubMsg,
  1709.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory,
  1710.     PFORMAT_STRING                          pFormat,
  1711.     unsigned char                           fMustAlloc
  1712.     );
  1713.  
  1714. /* Context handles */
  1715.  
  1716. RPCRTAPI
  1717. void
  1718. RPC_ENTRY
  1719. NdrClientContextUnmarshall(
  1720.     PMIDL_STUB_MESSAGE          pStubMsg,
  1721.     NDR_CCONTEXT __RPC_FAR *    pContextHandle,
  1722.     RPC_BINDING_HANDLE          BindHandle
  1723.     );
  1724.  
  1725. RPCRTAPI
  1726. NDR_SCONTEXT
  1727. RPC_ENTRY
  1728. NdrServerContextUnmarshall(
  1729.     PMIDL_STUB_MESSAGE          pStubMsg
  1730.     );
  1731.  
  1732. /*
  1733.  * Buffer sizing routines
  1734.  */
  1735.  
  1736. RPCRTAPI
  1737. void
  1738. RPC_ENTRY
  1739. NdrPointerBufferSize(
  1740.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1741.     unsigned char __RPC_FAR *           pMemory,
  1742.     PFORMAT_STRING                      pFormat
  1743.     );
  1744.  
  1745. /* Structures */
  1746.  
  1747. RPCRTAPI
  1748. void
  1749. RPC_ENTRY
  1750. NdrSimpleStructBufferSize(
  1751.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1752.     unsigned char __RPC_FAR *           pMemory,
  1753.     PFORMAT_STRING                      pFormat
  1754.     );
  1755.  
  1756. RPCRTAPI
  1757. void
  1758. RPC_ENTRY
  1759. NdrConformantStructBufferSize(
  1760.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1761.     unsigned char __RPC_FAR *           pMemory,
  1762.     PFORMAT_STRING                      pFormat
  1763.     );
  1764.  
  1765. RPCRTAPI
  1766. void
  1767. RPC_ENTRY
  1768. NdrConformantVaryingStructBufferSize(
  1769.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1770.     unsigned char __RPC_FAR *           pMemory,
  1771.     PFORMAT_STRING                      pFormat
  1772.     );
  1773.  
  1774. RPCRTAPI
  1775. void
  1776. RPC_ENTRY
  1777. NdrHardStructBufferSize(
  1778.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1779.     unsigned char __RPC_FAR *           pMemory,
  1780.     PFORMAT_STRING                      pFormat
  1781.     );
  1782.  
  1783. RPCRTAPI
  1784. void
  1785. RPC_ENTRY
  1786. NdrComplexStructBufferSize(
  1787.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1788.     unsigned char __RPC_FAR *           pMemory,
  1789.     PFORMAT_STRING                      pFormat
  1790.     );
  1791.  
  1792. /* Arrays */
  1793.  
  1794. RPCRTAPI
  1795. void
  1796. RPC_ENTRY
  1797. NdrFixedArrayBufferSize(
  1798.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1799.     unsigned char __RPC_FAR *           pMemory,
  1800.     PFORMAT_STRING                      pFormat
  1801.     );
  1802.  
  1803. RPCRTAPI
  1804. void
  1805. RPC_ENTRY
  1806. NdrConformantArrayBufferSize(
  1807.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1808.     unsigned char __RPC_FAR *           pMemory,
  1809.     PFORMAT_STRING                      pFormat
  1810.     );
  1811.  
  1812. RPCRTAPI
  1813. void
  1814. RPC_ENTRY
  1815. NdrConformantVaryingArrayBufferSize(
  1816.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1817.     unsigned char __RPC_FAR *           pMemory,
  1818.     PFORMAT_STRING                      pFormat
  1819.     );
  1820.  
  1821. RPCRTAPI
  1822. void
  1823. RPC_ENTRY
  1824. NdrVaryingArrayBufferSize(
  1825.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1826.     unsigned char __RPC_FAR *           pMemory,
  1827.     PFORMAT_STRING                      pFormat
  1828.     );
  1829.  
  1830. RPCRTAPI
  1831. void
  1832. RPC_ENTRY
  1833. NdrComplexArrayBufferSize(
  1834.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1835.     unsigned char __RPC_FAR *           pMemory,
  1836.     PFORMAT_STRING                      pFormat
  1837.     );
  1838.  
  1839. /* Strings */
  1840.  
  1841. RPCRTAPI
  1842. void
  1843. RPC_ENTRY
  1844. NdrConformantStringBufferSize(
  1845.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1846.     unsigned char __RPC_FAR *           pMemory,
  1847.     PFORMAT_STRING                      pFormat
  1848.     );
  1849.  
  1850. RPCRTAPI
  1851. void
  1852. RPC_ENTRY
  1853. NdrNonConformantStringBufferSize(
  1854.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1855.     unsigned char __RPC_FAR *           pMemory,
  1856.     PFORMAT_STRING                      pFormat
  1857.     );
  1858.  
  1859. /* Unions */
  1860.  
  1861. RPCRTAPI
  1862. void
  1863. RPC_ENTRY
  1864. NdrEncapsulatedUnionBufferSize(
  1865.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1866.     unsigned char __RPC_FAR *           pMemory,
  1867.     PFORMAT_STRING                      pFormat
  1868.     );
  1869.  
  1870. RPCRTAPI
  1871. void
  1872. RPC_ENTRY
  1873. NdrNonEncapsulatedUnionBufferSize(
  1874.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1875.     unsigned char __RPC_FAR *           pMemory,
  1876.     PFORMAT_STRING                      pFormat
  1877.     );
  1878.  
  1879. /* Byte count pointer */
  1880.  
  1881. RPCRTAPI
  1882. void
  1883. RPC_ENTRY
  1884. NdrByteCountPointerBufferSize(
  1885.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1886.     unsigned char __RPC_FAR *           pMemory,
  1887.     PFORMAT_STRING                      pFormat
  1888.     );
  1889.  
  1890. /* Transmit as and represent as*/
  1891.  
  1892. RPCRTAPI
  1893. void
  1894. RPC_ENTRY
  1895. NdrXmitOrRepAsBufferSize(
  1896.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1897.     unsigned char __RPC_FAR *           pMemory,
  1898.     PFORMAT_STRING                      pFormat
  1899.     );
  1900.  
  1901. /* User_marshal */
  1902.  
  1903. RPCRTAPI
  1904. void
  1905. RPC_ENTRY
  1906. NdrUserMarshalBufferSize(
  1907.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1908.     unsigned char __RPC_FAR *           pMemory,
  1909.     PFORMAT_STRING                      pFormat
  1910.     );
  1911.  
  1912. /* Cairo Interface pointer */
  1913.  
  1914. RPCRTAPI
  1915. void
  1916. RPC_ENTRY
  1917. NdrInterfacePointerBufferSize(
  1918.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1919.     unsigned char __RPC_FAR *           pMemory,
  1920.     PFORMAT_STRING                      pFormat
  1921.     );
  1922.  
  1923. // Context Handle size
  1924. //
  1925. RPCRTAPI
  1926. void
  1927. RPC_ENTRY
  1928. NdrContextHandleSize(
  1929.     PMIDL_STUB_MESSAGE          pStubMsg,
  1930.     unsigned char __RPC_FAR *           pMemory,
  1931.     PFORMAT_STRING                      pFormat
  1932.     );
  1933.  
  1934. /*
  1935.  * Memory sizing routines
  1936.  */
  1937.  
  1938. RPCRTAPI
  1939. unsigned long
  1940. RPC_ENTRY
  1941. NdrPointerMemorySize(
  1942.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1943.     PFORMAT_STRING                      pFormat
  1944.     );
  1945.  
  1946. /* Structures */
  1947.  
  1948. RPCRTAPI
  1949. unsigned long
  1950. RPC_ENTRY
  1951. NdrSimpleStructMemorySize(
  1952.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1953.     PFORMAT_STRING                      pFormat
  1954.     );
  1955.  
  1956. RPCRTAPI
  1957. unsigned long
  1958. RPC_ENTRY
  1959. NdrConformantStructMemorySize(
  1960.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1961.     PFORMAT_STRING                      pFormat
  1962.     );
  1963.  
  1964. RPCRTAPI
  1965. unsigned long
  1966. RPC_ENTRY
  1967. NdrConformantVaryingStructMemorySize(
  1968.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1969.     PFORMAT_STRING                      pFormat
  1970.     );
  1971.  
  1972. RPCRTAPI
  1973. unsigned long
  1974. RPC_ENTRY
  1975. NdrHardStructMemorySize(
  1976.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1977.     PFORMAT_STRING                      pFormat
  1978.     );
  1979.  
  1980. RPCRTAPI
  1981. unsigned long
  1982. RPC_ENTRY
  1983. NdrComplexStructMemorySize(
  1984.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1985.     PFORMAT_STRING                      pFormat
  1986.     );
  1987.  
  1988. /* Arrays */
  1989.  
  1990. RPCRTAPI
  1991. unsigned long
  1992. RPC_ENTRY
  1993. NdrFixedArrayMemorySize(
  1994.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1995.     PFORMAT_STRING                      pFormat
  1996.     );
  1997.  
  1998. RPCRTAPI
  1999. unsigned long
  2000. RPC_ENTRY
  2001. NdrConformantArrayMemorySize(
  2002.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2003.     PFORMAT_STRING                      pFormat
  2004.     );
  2005.  
  2006. RPCRTAPI
  2007. unsigned long
  2008. RPC_ENTRY
  2009. NdrConformantVaryingArrayMemorySize(
  2010.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2011.     PFORMAT_STRING                      pFormat
  2012.     );
  2013.  
  2014. RPCRTAPI
  2015. unsigned long
  2016. RPC_ENTRY
  2017. NdrVaryingArrayMemorySize(
  2018.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2019.     PFORMAT_STRING                      pFormat
  2020.     );
  2021.  
  2022. RPCRTAPI
  2023. unsigned long
  2024. RPC_ENTRY
  2025. NdrComplexArrayMemorySize(
  2026.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2027.     PFORMAT_STRING                      pFormat
  2028.     );
  2029.  
  2030. /* Strings */
  2031.  
  2032. RPCRTAPI
  2033. unsigned long
  2034. RPC_ENTRY
  2035. NdrConformantStringMemorySize(
  2036.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2037.     PFORMAT_STRING                      pFormat
  2038.     );
  2039.  
  2040. RPCRTAPI
  2041. unsigned long
  2042. RPC_ENTRY
  2043. NdrNonConformantStringMemorySize(
  2044.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2045.     PFORMAT_STRING                      pFormat
  2046.     );
  2047.  
  2048. /* Unions */
  2049.  
  2050. RPCRTAPI
  2051. unsigned long
  2052. RPC_ENTRY
  2053. NdrEncapsulatedUnionMemorySize(
  2054.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2055.     PFORMAT_STRING                      pFormat
  2056.     );
  2057.  
  2058. RPCRTAPI
  2059. unsigned long
  2060. RPC_ENTRY
  2061. NdrNonEncapsulatedUnionMemorySize(
  2062.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2063.     PFORMAT_STRING                      pFormat
  2064.     );
  2065.  
  2066. /* Transmit as and represent as*/
  2067.  
  2068. RPCRTAPI
  2069. unsigned long
  2070. RPC_ENTRY
  2071. NdrXmitOrRepAsMemorySize(
  2072.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2073.     PFORMAT_STRING                      pFormat
  2074.     );
  2075.  
  2076. /* User_marshal */
  2077.  
  2078. RPCRTAPI
  2079. unsigned long
  2080. RPC_ENTRY
  2081. NdrUserMarshalMemorySize(
  2082.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2083.     PFORMAT_STRING                      pFormat
  2084.     );
  2085.  
  2086. /* Cairo Interface pointer */
  2087.  
  2088. RPCRTAPI
  2089. unsigned long
  2090. RPC_ENTRY
  2091. NdrInterfacePointerMemorySize(
  2092.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2093.     PFORMAT_STRING                      pFormat
  2094.     );
  2095.  
  2096. /*
  2097.  * Freeing routines
  2098.  */
  2099.  
  2100. RPCRTAPI
  2101. void
  2102. RPC_ENTRY
  2103. NdrPointerFree(
  2104.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2105.     unsigned char __RPC_FAR *           pMemory,
  2106.     PFORMAT_STRING                      pFormat
  2107.     );
  2108.  
  2109. /* Structures */
  2110.  
  2111. RPCRTAPI
  2112. void
  2113. RPC_ENTRY
  2114. NdrSimpleStructFree(
  2115.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2116.     unsigned char __RPC_FAR *           pMemory,
  2117.     PFORMAT_STRING                      pFormat
  2118.     );
  2119.  
  2120. RPCRTAPI
  2121. void
  2122. RPC_ENTRY
  2123. NdrConformantStructFree(
  2124.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2125.     unsigned char __RPC_FAR *           pMemory,
  2126.     PFORMAT_STRING                      pFormat
  2127.     );
  2128.  
  2129. RPCRTAPI
  2130. void
  2131. RPC_ENTRY
  2132. NdrConformantVaryingStructFree(
  2133.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2134.     unsigned char __RPC_FAR *           pMemory,
  2135.     PFORMAT_STRING                      pFormat
  2136.     );
  2137.  
  2138. RPCRTAPI
  2139. void
  2140. RPC_ENTRY
  2141. NdrHardStructFree(
  2142.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2143.     unsigned char __RPC_FAR *           pMemory,
  2144.     PFORMAT_STRING                      pFormat
  2145.     );
  2146.  
  2147. RPCRTAPI
  2148. void
  2149. RPC_ENTRY
  2150. NdrComplexStructFree(
  2151.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2152.     unsigned char __RPC_FAR *           pMemory,
  2153.     PFORMAT_STRING                      pFormat
  2154.     );
  2155.  
  2156. /* Arrays */
  2157.  
  2158. RPCRTAPI
  2159. void
  2160. RPC_ENTRY
  2161. NdrFixedArrayFree(
  2162.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2163.     unsigned char __RPC_FAR *           pMemory,
  2164.     PFORMAT_STRING                      pFormat
  2165.     );
  2166.  
  2167. RPCRTAPI
  2168. void
  2169. RPC_ENTRY
  2170. NdrConformantArrayFree(
  2171.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2172.     unsigned char __RPC_FAR *           pMemory,
  2173.     PFORMAT_STRING                      pFormat
  2174.     );
  2175.  
  2176. RPCRTAPI
  2177. void
  2178. RPC_ENTRY
  2179. NdrConformantVaryingArrayFree(
  2180.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2181.     unsigned char __RPC_FAR *           pMemory,
  2182.     PFORMAT_STRING                      pFormat
  2183.     );
  2184.  
  2185. RPCRTAPI
  2186. void
  2187. RPC_ENTRY
  2188. NdrVaryingArrayFree(
  2189.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2190.     unsigned char __RPC_FAR *           pMemory,
  2191.     PFORMAT_STRING                      pFormat
  2192.     );
  2193.  
  2194. RPCRTAPI
  2195. void
  2196. RPC_ENTRY
  2197. NdrComplexArrayFree(
  2198.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2199.     unsigned char __RPC_FAR *           pMemory,
  2200.     PFORMAT_STRING                      pFormat
  2201.     );
  2202.  
  2203. /* Unions */
  2204.  
  2205. RPCRTAPI
  2206. void
  2207. RPC_ENTRY
  2208. NdrEncapsulatedUnionFree(
  2209.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2210.     unsigned char __RPC_FAR *           pMemory,
  2211.     PFORMAT_STRING                      pFormat
  2212.     );
  2213.  
  2214. RPCRTAPI
  2215. void
  2216. RPC_ENTRY
  2217. NdrNonEncapsulatedUnionFree(
  2218.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2219.     unsigned char __RPC_FAR *           pMemory,
  2220.     PFORMAT_STRING                      pFormat
  2221.     );
  2222.  
  2223. /* Byte count */
  2224.  
  2225. RPCRTAPI
  2226. void
  2227. RPC_ENTRY
  2228. NdrByteCountPointerFree(
  2229.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2230.     unsigned char __RPC_FAR *           pMemory,
  2231.     PFORMAT_STRING                      pFormat
  2232.     );
  2233.  
  2234. /* Transmit as and represent as*/
  2235.  
  2236. RPCRTAPI
  2237. void
  2238. RPC_ENTRY
  2239. NdrXmitOrRepAsFree(
  2240.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2241.     unsigned char __RPC_FAR *           pMemory,
  2242.     PFORMAT_STRING                      pFormat
  2243.     );
  2244.  
  2245. /* User_marshal */
  2246.  
  2247. RPCRTAPI
  2248. void
  2249. RPC_ENTRY
  2250. NdrUserMarshalFree(
  2251.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2252.     unsigned char __RPC_FAR *           pMemory,
  2253.     PFORMAT_STRING                      pFormat
  2254.     );
  2255.  
  2256. /* Cairo Interface pointer */
  2257.  
  2258. RPCRTAPI
  2259. void
  2260. RPC_ENTRY
  2261. NdrInterfacePointerFree(
  2262.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2263.     unsigned char __RPC_FAR *           pMemory,
  2264.     PFORMAT_STRING                      pFormat
  2265.     );
  2266.  
  2267. /*
  2268.  * Endian conversion routine.
  2269.  */
  2270.  
  2271. RPCRTAPI
  2272. void
  2273. RPC_ENTRY
  2274. NdrConvert2(
  2275.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2276.     PFORMAT_STRING                      pFormat,
  2277.     long                                NumberParams
  2278.     );
  2279.  
  2280. RPCRTAPI
  2281. void
  2282. RPC_ENTRY
  2283. NdrConvert(
  2284.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2285.     PFORMAT_STRING                      pFormat
  2286.     );
  2287.  
  2288. #define USER_MARSHAL_FC_BYTE         1
  2289. #define USER_MARSHAL_FC_CHAR         2
  2290. #define USER_MARSHAL_FC_SMALL        3
  2291. #define USER_MARSHAL_FC_USMALL       4
  2292. #define USER_MARSHAL_FC_WCHAR        5
  2293. #define USER_MARSHAL_FC_SHORT        6
  2294. #define USER_MARSHAL_FC_USHORT       7
  2295. #define USER_MARSHAL_FC_LONG         8
  2296. #define USER_MARSHAL_FC_ULONG        9
  2297. #define USER_MARSHAL_FC_FLOAT       10
  2298. #define USER_MARSHAL_FC_HYPER       11
  2299. #define USER_MARSHAL_FC_DOUBLE      12
  2300.  
  2301. RPCRTAPI
  2302. unsigned char __RPC_FAR *
  2303. RPC_ENTRY
  2304. NdrUserMarshalSimpleTypeConvert(
  2305.     unsigned long * pFlags,
  2306.     unsigned char * pBuffer,
  2307.     unsigned char   FormatChar
  2308.     );
  2309.  
  2310. /*
  2311.  * Auxilary routines
  2312.  */
  2313.  
  2314. RPCRTAPI
  2315. void
  2316. RPC_ENTRY
  2317. NdrClientInitializeNew(
  2318.     PRPC_MESSAGE                        pRpcMsg,
  2319.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2320.     PMIDL_STUB_DESC                     pStubDescriptor,
  2321.     unsigned int                        ProcNum
  2322.     );
  2323.  
  2324. RPCRTAPI
  2325. unsigned char __RPC_FAR *
  2326. RPC_ENTRY
  2327. NdrServerInitializeNew(
  2328.     PRPC_MESSAGE                        pRpcMsg,
  2329.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2330.     PMIDL_STUB_DESC                     pStubDescriptor
  2331.     );
  2332.  
  2333. RPCRTAPI
  2334. void
  2335. RPC_ENTRY
  2336. NdrServerInitializePartial(
  2337.     PRPC_MESSAGE                        pRpcMsg,
  2338.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2339.     PMIDL_STUB_DESC                     pStubDescriptor,
  2340.     unsigned long                       RequestedBufferSize
  2341.     );
  2342.  
  2343. RPCRTAPI
  2344. void
  2345. RPC_ENTRY
  2346. NdrClientInitialize(
  2347.     PRPC_MESSAGE                        pRpcMsg,
  2348.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2349.     PMIDL_STUB_DESC                     pStubDescriptor,
  2350.     unsigned int                        ProcNum
  2351.     );
  2352.  
  2353. RPCRTAPI
  2354. unsigned char __RPC_FAR *
  2355. RPC_ENTRY
  2356. NdrServerInitialize(
  2357.     PRPC_MESSAGE                        pRpcMsg,
  2358.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2359.     PMIDL_STUB_DESC                     pStubDescriptor
  2360.     );
  2361.  
  2362. RPCRTAPI
  2363. unsigned char __RPC_FAR *
  2364. RPC_ENTRY
  2365. NdrServerInitializeUnmarshall (
  2366.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2367.     PMIDL_STUB_DESC                     pStubDescriptor,
  2368.     PRPC_MESSAGE                        pRpcMsg
  2369.     );
  2370.  
  2371. RPCRTAPI
  2372. void
  2373. RPC_ENTRY
  2374. NdrServerInitializeMarshall (
  2375.     PRPC_MESSAGE                        pRpcMsg,
  2376.     PMIDL_STUB_MESSAGE                  pStubMsg
  2377.     );
  2378.  
  2379. RPCRTAPI
  2380. unsigned char __RPC_FAR *
  2381. RPC_ENTRY
  2382. NdrGetBuffer(
  2383.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2384.     unsigned long                       BufferLength,
  2385.     RPC_BINDING_HANDLE                  Handle
  2386.     );
  2387.  
  2388. RPCRTAPI
  2389. unsigned char __RPC_FAR *
  2390. RPC_ENTRY
  2391. NdrNsGetBuffer(
  2392.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2393.     unsigned long                       BufferLength,
  2394.     RPC_BINDING_HANDLE                  Handle
  2395.     );
  2396.  
  2397. RPCRTAPI
  2398. unsigned char __RPC_FAR *
  2399. RPC_ENTRY
  2400. NdrGetPipeBuffer(
  2401.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2402.     unsigned long                       BufferLength,
  2403.     RPC_BINDING_HANDLE                  Handle );
  2404.  
  2405. RPCRTAPI
  2406. void
  2407. RPC_ENTRY
  2408. NdrGetPartialBuffer(
  2409.     PMIDL_STUB_MESSAGE                  pStubMsg );
  2410.  
  2411. RPCRTAPI
  2412. unsigned char __RPC_FAR *
  2413. RPC_ENTRY
  2414. NdrSendReceive(
  2415.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2416.     unsigned char __RPC_FAR*            pBufferEnd
  2417.     );
  2418.  
  2419. RPCRTAPI
  2420. unsigned char __RPC_FAR *
  2421. RPC_ENTRY
  2422. NdrNsSendReceive(
  2423.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2424.     unsigned char __RPC_FAR *           pBufferEnd,
  2425.     RPC_BINDING_HANDLE __RPC_FAR *      pAutoHandle
  2426.     );
  2427.  
  2428. RPCRTAPI
  2429. void
  2430. RPC_ENTRY
  2431. NdrPipeSendReceive(
  2432.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2433.     PNDR_PIPE_DESC                      pPipeDesc
  2434.     );
  2435.  
  2436. RPCRTAPI
  2437. void
  2438. RPC_ENTRY
  2439. NdrFreeBuffer(
  2440.     PMIDL_STUB_MESSAGE                  pStubMsg
  2441.     );
  2442.  
  2443. RPCRTAPI
  2444. RPC_STATUS
  2445. RPC_ENTRY
  2446. NdrGetDcomProtocolVersion( 
  2447.     PMIDL_STUB_MESSAGE   pStubMsg,
  2448.     RPC_VERSION *        pVersion );
  2449.  
  2450.  
  2451. /*
  2452.  * Pipe specific calls
  2453.  */
  2454.  
  2455. RPCRTAPI
  2456. void
  2457. RPC_ENTRY
  2458. NdrPipesInitialize(
  2459.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2460.     PFORMAT_STRING                      pParamDesc,
  2461.     PNDR_PIPE_DESC                      pPipeDesc,
  2462.     PNDR_PIPE_MESSAGE                   pPipeMsg,
  2463.     char             __RPC_FAR *        pStackTop,
  2464.     unsigned long                       NumberParams );
  2465.  
  2466. RPCRTAPI
  2467. void
  2468. RPC_ENTRY
  2469. NdrPipePull(
  2470.     char          __RPC_FAR *           pState,
  2471.     void          __RPC_FAR *           buf,
  2472.     unsigned long                       esize,
  2473.     unsigned long __RPC_FAR *           ecount );
  2474.  
  2475. RPCRTAPI
  2476. void
  2477. RPC_ENTRY
  2478. NdrPipePush(
  2479.     char          __RPC_FAR *           pState,
  2480.     void          __RPC_FAR *           buf,
  2481.     unsigned long                       ecount );
  2482.  
  2483. RPCRTAPI
  2484. void
  2485. RPC_ENTRY
  2486. NdrIsAppDoneWithPipes(
  2487.     PNDR_PIPE_DESC                      pPipeDesc
  2488.     );
  2489.  
  2490. RPCRTAPI
  2491. void
  2492. RPC_ENTRY
  2493. NdrPipesDone(
  2494.     PMIDL_STUB_MESSAGE                  pStubMsg
  2495.     );
  2496.  
  2497.  
  2498. /*
  2499.  * Interpeter calls.
  2500.  */
  2501.  
  2502. /* client */
  2503.  
  2504. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2505. NdrClientCall2(
  2506.     PMIDL_STUB_DESC                     pStubDescriptor,
  2507.     PFORMAT_STRING                      pFormat,
  2508.     ...
  2509.     );
  2510.  
  2511. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2512. NdrClientCall(
  2513.     PMIDL_STUB_DESC                     pStubDescriptor,
  2514.     PFORMAT_STRING                      pFormat,
  2515.     ...
  2516.     );
  2517.  
  2518. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  2519. NdrAsyncClientCall(
  2520.     PMIDL_STUB_DESC     pStubDescriptor,
  2521.     PFORMAT_STRING      pFormat,
  2522.     ...
  2523.     );
  2524.  
  2525. /* server */
  2526. typedef enum {
  2527.     STUB_UNMARSHAL,
  2528.     STUB_CALL_SERVER,
  2529.     STUB_MARSHAL,
  2530.     STUB_CALL_SERVER_NO_HRESULT
  2531. }STUB_PHASE;
  2532.  
  2533. typedef enum {
  2534.     PROXY_CALCSIZE,
  2535.     PROXY_GETBUFFER,
  2536.     PROXY_MARSHAL,
  2537.     PROXY_SENDRECEIVE,
  2538.     PROXY_UNMARSHAL
  2539. }PROXY_PHASE;
  2540.  
  2541. struct IRpcStubBuffer;      // Forward declaration
  2542.  
  2543. RPCRTAPI
  2544. long
  2545. RPC_ENTRY
  2546. NdrAsyncStubCall(
  2547.     struct IRpcStubBuffer *             pThis,
  2548.     struct IRpcChannelBuffer *          pChannel,
  2549.     PRPC_MESSAGE                        pRpcMsg,
  2550.     unsigned long *                     pdwStubPhase
  2551.     );
  2552.  
  2553. RPCRTAPI
  2554. void
  2555. RPC_ENTRY
  2556. NdrAsyncServerCall(
  2557.     PRPC_MESSAGE                        pRpcMsg
  2558.     );
  2559.  
  2560. RPCRTAPI
  2561. long
  2562. RPC_ENTRY
  2563. NdrStubCall2(
  2564.     struct IRpcStubBuffer __RPC_FAR *    pThis,
  2565.     struct IRpcChannelBuffer __RPC_FAR * pChannel,
  2566.     PRPC_MESSAGE                         pRpcMsg,
  2567.     unsigned long __RPC_FAR *            pdwStubPhase
  2568.     );
  2569.  
  2570. RPCRTAPI
  2571. void
  2572. RPC_ENTRY
  2573. NdrServerCall2(
  2574.     PRPC_MESSAGE                        pRpcMsg
  2575.     );
  2576.  
  2577. RPCRTAPI
  2578. long
  2579. RPC_ENTRY
  2580. NdrStubCall (
  2581.     struct IRpcStubBuffer __RPC_FAR *    pThis,
  2582.     struct IRpcChannelBuffer __RPC_FAR * pChannel,
  2583.     PRPC_MESSAGE                         pRpcMsg,
  2584.     unsigned long __RPC_FAR *            pdwStubPhase
  2585.     );
  2586.  
  2587. RPCRTAPI
  2588. void
  2589. RPC_ENTRY
  2590. NdrServerCall(
  2591.     PRPC_MESSAGE                        pRpcMsg
  2592.     );
  2593.  
  2594. RPCRTAPI
  2595. int
  2596. RPC_ENTRY
  2597. NdrServerUnmarshall(
  2598.     struct IRpcChannelBuffer __RPC_FAR * pChannel,
  2599.     PRPC_MESSAGE                         pRpcMsg,
  2600.     PMIDL_STUB_MESSAGE                   pStubMsg,
  2601.     PMIDL_STUB_DESC                      pStubDescriptor,
  2602.     PFORMAT_STRING                       pFormat,
  2603.     void __RPC_FAR *                     pParamList
  2604.     );
  2605.  
  2606. RPCRTAPI
  2607. void
  2608. RPC_ENTRY
  2609. NdrServerMarshall(
  2610.     struct IRpcStubBuffer __RPC_FAR *    pThis,
  2611.     struct IRpcChannelBuffer __RPC_FAR * pChannel,
  2612.     PMIDL_STUB_MESSAGE                   pStubMsg,
  2613.     PFORMAT_STRING                       pFormat
  2614.     );
  2615.  
  2616. /* Comm and Fault status */
  2617.  
  2618. RPCRTAPI
  2619. RPC_STATUS
  2620. RPC_ENTRY
  2621. NdrMapCommAndFaultStatus(
  2622.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2623.     unsigned long __RPC_FAR *                       pCommStatus,
  2624.     unsigned long __RPC_FAR *                       pFaultStatus,
  2625.     RPC_STATUS                          Status
  2626.     );
  2627.  
  2628. /* Helper routines */
  2629.  
  2630. RPCRTAPI
  2631. int
  2632. RPC_ENTRY
  2633. NdrSH_UPDecision(
  2634.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2635.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  2636.     RPC_BUFPTR                          pBuffer
  2637.     );
  2638.  
  2639. RPCRTAPI
  2640. int
  2641. RPC_ENTRY
  2642. NdrSH_TLUPDecision(
  2643.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2644.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem
  2645.     );
  2646.  
  2647. RPCRTAPI
  2648. int
  2649. RPC_ENTRY
  2650. NdrSH_TLUPDecisionBuffer(
  2651.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2652.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem
  2653.     );
  2654.  
  2655. RPCRTAPI
  2656. int
  2657. RPC_ENTRY
  2658. NdrSH_IfAlloc(
  2659.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2660.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  2661.     unsigned long                       Count
  2662.     );
  2663.  
  2664. RPCRTAPI
  2665. int
  2666. RPC_ENTRY
  2667. NdrSH_IfAllocRef(
  2668.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2669.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  2670.     unsigned long                       Count
  2671.     );
  2672.  
  2673. RPCRTAPI
  2674. int
  2675. RPC_ENTRY
  2676. NdrSH_IfAllocSet(
  2677.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2678.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  2679.     unsigned long                       Count
  2680.     );
  2681.  
  2682. RPCRTAPI
  2683. RPC_BUFPTR
  2684. RPC_ENTRY
  2685. NdrSH_IfCopy(
  2686.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2687.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  2688.     unsigned long                       Count
  2689.     );
  2690.  
  2691. RPCRTAPI
  2692. RPC_BUFPTR
  2693. RPC_ENTRY
  2694. NdrSH_IfAllocCopy(
  2695.     PMIDL_STUB_MESSAGE                  pStubMsg,
  2696.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  2697.     unsigned long                       Count
  2698.     );
  2699.  
  2700. RPCRTAPI
  2701. unsigned long
  2702. RPC_ENTRY
  2703. NdrSH_Copy(
  2704.     unsigned char           __RPC_FAR *         pStubMsg,
  2705.     unsigned char           __RPC_FAR *         pPtrInMem,
  2706.     unsigned long                       Count
  2707.     );
  2708.  
  2709. RPCRTAPI
  2710. void
  2711. RPC_ENTRY
  2712. NdrSH_IfFree(
  2713.     PMIDL_STUB_MESSAGE                  pMessage,
  2714.     unsigned char           __RPC_FAR *         pPtr );
  2715.  
  2716.  
  2717. RPCRTAPI
  2718. RPC_BUFPTR
  2719. RPC_ENTRY
  2720. NdrSH_StringMarshall(
  2721.     PMIDL_STUB_MESSAGE                  pMessage,
  2722.     unsigned char           __RPC_FAR *         pMemory,
  2723.     unsigned long                       Count,
  2724.     int                                 Size );
  2725.  
  2726. RPCRTAPI
  2727. RPC_BUFPTR
  2728. RPC_ENTRY
  2729. NdrSH_StringUnMarshall(
  2730.     PMIDL_STUB_MESSAGE                  pMessage,
  2731.     unsigned char           __RPC_FAR *__RPC_FAR *          pMemory,
  2732.     int                                 Size );
  2733.  
  2734. /****************************************************************************
  2735.     MIDL 2.0 memory package: rpc_ss_* rpc_sm_*
  2736.  ****************************************************************************/
  2737.  
  2738. typedef void __RPC_FAR * RPC_SS_THREAD_HANDLE;
  2739.  
  2740. typedef void __RPC_FAR * __RPC_API
  2741. RPC_CLIENT_ALLOC (
  2742.     IN size_t Size
  2743.     );
  2744.  
  2745. typedef void __RPC_API
  2746. RPC_CLIENT_FREE (
  2747.     IN void __RPC_FAR * Ptr
  2748.     );
  2749.  
  2750. /*++
  2751.      RpcSs* package
  2752. --*/
  2753.  
  2754. RPCRTAPI
  2755. void __RPC_FAR *
  2756. RPC_ENTRY
  2757. RpcSsAllocate (
  2758.     IN size_t Size
  2759.     );
  2760.  
  2761. RPCRTAPI
  2762. void
  2763. RPC_ENTRY
  2764. RpcSsDisableAllocate (
  2765.     void
  2766.     );
  2767.  
  2768. RPCRTAPI
  2769. void
  2770. RPC_ENTRY
  2771. RpcSsEnableAllocate (
  2772.     void
  2773.     );
  2774.  
  2775. RPCRTAPI
  2776. void
  2777. RPC_ENTRY
  2778. RpcSsFree (
  2779.     IN void __RPC_FAR * NodeToFree
  2780.     );
  2781.  
  2782. RPCRTAPI
  2783. RPC_SS_THREAD_HANDLE
  2784. RPC_ENTRY
  2785. RpcSsGetThreadHandle (
  2786.     void
  2787.     );
  2788.  
  2789. RPCRTAPI
  2790. void
  2791. RPC_ENTRY
  2792. RpcSsSetClientAllocFree (
  2793.     IN RPC_CLIENT_ALLOC __RPC_FAR * ClientAlloc,
  2794.     IN RPC_CLIENT_FREE __RPC_FAR * ClientFree
  2795.     );
  2796.  
  2797. RPCRTAPI
  2798. void
  2799. RPC_ENTRY
  2800. RpcSsSetThreadHandle (
  2801.     IN RPC_SS_THREAD_HANDLE Id
  2802.     );
  2803.  
  2804. RPCRTAPI
  2805. void
  2806. RPC_ENTRY
  2807. RpcSsSwapClientAllocFree (
  2808.     IN RPC_CLIENT_ALLOC __RPC_FAR * ClientAlloc,
  2809.     IN RPC_CLIENT_FREE __RPC_FAR * ClientFree,
  2810.     OUT RPC_CLIENT_ALLOC __RPC_FAR * __RPC_FAR * OldClientAlloc,
  2811.     OUT RPC_CLIENT_FREE __RPC_FAR * __RPC_FAR * OldClientFree
  2812.     );
  2813.  
  2814. /*++
  2815.      RpcSm* package
  2816. --*/
  2817.  
  2818. RPCRTAPI
  2819. void __RPC_FAR *
  2820. RPC_ENTRY
  2821. RpcSmAllocate (
  2822.     IN  size_t          Size,
  2823.     OUT RPC_STATUS __RPC_FAR *    pStatus
  2824.     );
  2825.  
  2826. RPCRTAPI
  2827. RPC_STATUS
  2828. RPC_ENTRY
  2829. RpcSmClientFree (
  2830.     IN  void __RPC_FAR * pNodeToFree
  2831.     );
  2832.  
  2833. RPCRTAPI
  2834. RPC_STATUS
  2835. RPC_ENTRY
  2836. RpcSmDestroyClientContext (
  2837.     IN void __RPC_FAR * __RPC_FAR * ContextHandle
  2838.     );
  2839.  
  2840. RPCRTAPI
  2841. RPC_STATUS
  2842. RPC_ENTRY
  2843. RpcSmDisableAllocate (
  2844.     void
  2845.     );
  2846.  
  2847. RPCRTAPI
  2848. RPC_STATUS
  2849. RPC_ENTRY
  2850. RpcSmEnableAllocate (
  2851.     void
  2852.     );
  2853.  
  2854. RPCRTAPI
  2855. RPC_STATUS
  2856. RPC_ENTRY
  2857. RpcSmFree (
  2858.     IN void __RPC_FAR * NodeToFree
  2859.     );
  2860.  
  2861. RPCRTAPI
  2862. RPC_SS_THREAD_HANDLE
  2863. RPC_ENTRY
  2864. RpcSmGetThreadHandle (
  2865.     OUT RPC_STATUS __RPC_FAR *    pStatus
  2866.     );
  2867.  
  2868. RPCRTAPI
  2869. RPC_STATUS
  2870. RPC_ENTRY
  2871. RpcSmSetClientAllocFree (
  2872.     IN RPC_CLIENT_ALLOC __RPC_FAR * ClientAlloc,
  2873.     IN RPC_CLIENT_FREE __RPC_FAR * ClientFree
  2874.     );
  2875.  
  2876. RPCRTAPI
  2877. RPC_STATUS
  2878. RPC_ENTRY
  2879. RpcSmSetThreadHandle (
  2880.     IN RPC_SS_THREAD_HANDLE Id
  2881.     );
  2882.  
  2883. RPCRTAPI
  2884. RPC_STATUS
  2885. RPC_ENTRY
  2886. RpcSmSwapClientAllocFree (
  2887.     IN RPC_CLIENT_ALLOC __RPC_FAR * ClientAlloc,
  2888.     IN RPC_CLIENT_FREE __RPC_FAR * ClientFree,
  2889.     OUT RPC_CLIENT_ALLOC __RPC_FAR * __RPC_FAR * OldClientAlloc,
  2890.     OUT RPC_CLIENT_FREE __RPC_FAR * __RPC_FAR * OldClientFree
  2891.     );
  2892.  
  2893. /*++
  2894.      Ndr stub entry points
  2895. --*/
  2896.  
  2897. RPCRTAPI
  2898. void
  2899. RPC_ENTRY
  2900. NdrRpcSsEnableAllocate(
  2901.     PMIDL_STUB_MESSAGE      pMessage );
  2902.  
  2903. RPCRTAPI
  2904. void
  2905. RPC_ENTRY
  2906. NdrRpcSsDisableAllocate(
  2907.     PMIDL_STUB_MESSAGE      pMessage );
  2908.  
  2909. RPCRTAPI
  2910. void
  2911. RPC_ENTRY
  2912. NdrRpcSmSetClientToOsf(
  2913.     PMIDL_STUB_MESSAGE      pMessage );
  2914.  
  2915. RPCRTAPI
  2916. void __RPC_FAR *
  2917. RPC_ENTRY
  2918. NdrRpcSmClientAllocate (
  2919.     IN size_t Size
  2920.     );
  2921.  
  2922. RPCRTAPI
  2923. void
  2924. RPC_ENTRY
  2925. NdrRpcSmClientFree (
  2926.     IN void __RPC_FAR * NodeToFree
  2927.     );
  2928.  
  2929. RPCRTAPI
  2930. void __RPC_FAR *
  2931. RPC_ENTRY
  2932. NdrRpcSsDefaultAllocate (
  2933.     IN size_t Size
  2934.     );
  2935.  
  2936. RPCRTAPI
  2937. void
  2938. RPC_ENTRY
  2939. NdrRpcSsDefaultFree (
  2940.     IN void __RPC_FAR * NodeToFree
  2941.     );
  2942.  
  2943. /****************************************************************************
  2944.     end of memory package: rpc_ss_* rpc_sm_*
  2945.  ****************************************************************************/
  2946.  
  2947. /****************************************************************************
  2948.  * Full Pointer APIs
  2949.  ****************************************************************************/
  2950.  
  2951. RPCRTAPI
  2952. PFULL_PTR_XLAT_TABLES
  2953. RPC_ENTRY
  2954. NdrFullPointerXlatInit(
  2955.     unsigned long           NumberOfPointers,
  2956.     XLAT_SIDE               XlatSide
  2957.     );
  2958.  
  2959. RPCRTAPI
  2960. void
  2961. RPC_ENTRY
  2962. NdrFullPointerXlatFree(
  2963.     PFULL_PTR_XLAT_TABLES   pXlatTables
  2964.     );
  2965.  
  2966. RPCRTAPI
  2967. int
  2968. RPC_ENTRY
  2969. NdrFullPointerQueryPointer(
  2970.     PFULL_PTR_XLAT_TABLES   pXlatTables,
  2971.     void __RPC_FAR *                    pPointer,
  2972.     unsigned char           QueryType,
  2973.     unsigned long __RPC_FAR *           pRefId
  2974.     );
  2975.  
  2976. RPCRTAPI
  2977. int
  2978. RPC_ENTRY
  2979. NdrFullPointerQueryRefId(
  2980.     PFULL_PTR_XLAT_TABLES   pXlatTables,
  2981.     unsigned long           RefId,
  2982.     unsigned char           QueryType,
  2983.     void __RPC_FAR *__RPC_FAR *                 ppPointer
  2984.     );
  2985.  
  2986. RPCRTAPI
  2987. void
  2988. RPC_ENTRY
  2989. NdrFullPointerInsertRefId(
  2990.     PFULL_PTR_XLAT_TABLES   pXlatTables,
  2991.     unsigned long           RefId,
  2992.     void __RPC_FAR *                    pPointer
  2993.     );
  2994.  
  2995. RPCRTAPI
  2996. int
  2997. RPC_ENTRY
  2998. NdrFullPointerFree(
  2999.     PFULL_PTR_XLAT_TABLES   pXlatTables,
  3000.     void __RPC_FAR *                    Pointer
  3001.     );
  3002.  
  3003. RPCRTAPI
  3004. void __RPC_FAR *
  3005. RPC_ENTRY
  3006. NdrAllocate(
  3007.     PMIDL_STUB_MESSAGE      pStubMsg,
  3008.     size_t                  Len
  3009.     );
  3010.  
  3011. RPCRTAPI
  3012. void
  3013. RPC_ENTRY
  3014. NdrClearOutParameters(
  3015.     PMIDL_STUB_MESSAGE      pStubMsg,
  3016.     PFORMAT_STRING          pFormat,
  3017.     void __RPC_FAR *        ArgAddr
  3018.     );
  3019.  
  3020.  
  3021. /****************************************************************************
  3022.  * Proxy APIs
  3023.  ****************************************************************************/
  3024.  
  3025. RPCRTAPI
  3026. void __RPC_FAR *
  3027. RPC_ENTRY
  3028. NdrOleAllocate (
  3029.     IN size_t Size
  3030.     );
  3031.  
  3032. RPCRTAPI
  3033. void
  3034. RPC_ENTRY
  3035. NdrOleFree (
  3036.     IN void __RPC_FAR * NodeToFree
  3037.     );
  3038.  
  3039. #ifdef CONST_VTABLE
  3040. #define CONST_VTBL const
  3041. #else
  3042. #define CONST_VTBL
  3043. #endif
  3044.  
  3045. /****************************************************************************
  3046.  * Special things for VC5 Com support
  3047.  ****************************************************************************/
  3048.  
  3049. #if (_MSC_VER >= 1100) && !defined(__BORLANDC__)
  3050. #define DECLSPEC_UUID(x)    __declspec(uuid(x))
  3051. #define MIDL_INTERFACE(x)   struct __declspec(uuid(x)) __declspec(novtable)
  3052. #else
  3053. #define DECLSPEC_UUID(x)
  3054. #define MIDL_INTERFACE(x)   struct
  3055. #endif
  3056.  
  3057. #if _MSC_VER >= 1100
  3058. #define EXTERN_GUID(itf,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8)  \
  3059.   EXTERN_C const IID __declspec(selectany) itf = {l1,s1,s2,{c1,c2,c3,c4,c5,c6,c7,c8}}
  3060. #else
  3061. #define EXTERN_GUID(itf,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8) EXTERN_C const IID itf
  3062. #endif
  3063.  
  3064. #ifdef __BORLANDC__
  3065.   /* This satisfies the undefined forward reference to these structures */
  3066.   struct _NDR_PIPE_DESC { int __dummy; };
  3067.   struct _NDR_PIPE_MESSAGE {int __dummy; };
  3068.   struct _NDR_ASYNC_MESSAGE {int __dummy; };
  3069. #endif
  3070.  
  3071.  
  3072. #ifdef __cplusplus
  3073. }
  3074. #endif
  3075.  
  3076. // Reset the packing level for DOS, Windows and Mac.
  3077.  
  3078. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__) || defined(__RPC_MAC__)
  3079. #pragma pack()
  3080. #endif
  3081.  
  3082. #pragma option pop
  3083. #endif /* __RPCNDR_H__ */
  3084.